Init
This commit is contained in:
127
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.cpp
Normal file
127
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
* DumpFeatureTree.cpp : Defines the entry point for the console application.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#define INITIALIZE_A3D_API
|
||||
#include "DumpFeatureTree.h"
|
||||
|
||||
#define TF_A3DLIBS
|
||||
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <vector>
|
||||
|
||||
#include "TreeTraverse.h"
|
||||
#include "VisitorContainer.h"
|
||||
#include "VisitorTree.h"
|
||||
#include "HXFeatureTreeReport.h"
|
||||
|
||||
|
||||
A3DVoid _InitializeFontsArray();
|
||||
A3DVoid _TerminateFontsArray();
|
||||
static A3DStatus TraverseModel(const A3DAsmModelFile* pModelFile, const char * pcOutputFile);
|
||||
|
||||
//=============================== TraverseModel function
|
||||
|
||||
static A3DStatus TraverseModel(const A3DAsmModelFile* pModelFile, const char * pcOutputFile)
|
||||
{
|
||||
// Creation of the ModelFile Connector
|
||||
A3DModelFileConnector sModelFileConnector(pModelFile);
|
||||
A3DVisitorContainer sCadVisitorContainer(CONNECT_FEATURE);
|
||||
sCadVisitorContainer.SetTraverseInstance(true);
|
||||
|
||||
HXFeatureTreeReport * pReport = new HXFeatureTreeReport(&sCadVisitorContainer);
|
||||
sCadVisitorContainer.push(pReport);
|
||||
|
||||
// Traverse the ModelFile Connector
|
||||
sModelFileConnector.Traverse(&sCadVisitorContainer);
|
||||
|
||||
pReport->SaveFile((const char *)pcOutputFile);
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static MY_CHAR acSrcFileName[_MAX_PATH * 2];
|
||||
static MY_CHAR acDstFileName[_MAX_PATH * 2];
|
||||
static MY_CHAR acLogFileName[_MAX_PATH * 2];
|
||||
|
||||
//######################################################################################################################
|
||||
#ifdef _MSC_VER
|
||||
int wmain(A3DInt32 iArgc, wchar_t** ppcArgv)
|
||||
#else
|
||||
int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
#endif
|
||||
{
|
||||
//
|
||||
// ### COMMAND LINE ARGUMENTS
|
||||
//
|
||||
|
||||
if (iArgc > 4)
|
||||
{
|
||||
MY_PRINTF2("Usage:\n %s [input CAD file] [output XML file] [output LOG file]\n", ppcArgv[0]);
|
||||
MY_PRINTF(" Default output XML file is [input CAD file].xml\n");
|
||||
MY_PRINTF(" Default output LOG file is [output XML file]_Log.txt\n\n");
|
||||
return A3D_ERROR;
|
||||
}
|
||||
|
||||
MY_PRINTF("This sample produces an XML file that is best viewed with a style sheet. \n");
|
||||
MY_PRINTF("Please copy FeatureHTML.xsl (found in \\samples\\exchange\\exchangesource\\DumpFeatureTree\\) in your XML output directory for better readability. \n");
|
||||
|
||||
if (iArgc > 1) MY_STRCPY(acSrcFileName, ppcArgv[1]);
|
||||
else MY_STRCPY(acSrcFileName, DEFAULT_INPUT_CAD);
|
||||
|
||||
if (iArgc > 2) MY_STRCPY(acDstFileName, ppcArgv[2]);
|
||||
else MY_SPRINTF(acDstFileName, "%s.xml", acSrcFileName);
|
||||
|
||||
if (iArgc > 3) MY_STRCPY(acLogFileName, ppcArgv[3]);
|
||||
else MY_SPRINTF(acLogFileName, "%s_Log.txt", acDstFileName);
|
||||
GetLogFile(acLogFileName); // Initialize log file
|
||||
|
||||
//
|
||||
// ### INITIALIZE HOOPS EXCHANGE
|
||||
//
|
||||
|
||||
A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(_T(HOOPS_BINARY_DIRECTORY));
|
||||
CHECK_RET(sHoopsExchangeLoader.m_eSDKStatus);
|
||||
|
||||
CHECK_RET(A3DDllSetCallbacksMemory(CheckMalloc, CheckFree));
|
||||
CHECK_RET(A3DDllSetCallbacksReport(PrintLogMessage, PrintLogWarning, PrintLogError));
|
||||
|
||||
//
|
||||
// ### PROCESS SAMPLE CODE
|
||||
//
|
||||
|
||||
A3DImport sImport(acSrcFileName); // see A3DSDKInternalConvert.hxx for import and export detailed parameters
|
||||
sImport.m_sLoadData.m_sGeneral.m_bReadFeature = TRUE;
|
||||
sImport.m_sLoadData.m_sGeneral.m_bReadHiddenObjects = TRUE;
|
||||
sImport.m_sLoadData.m_sGeneral.m_bReadConstructionAndReferences = TRUE;
|
||||
|
||||
A3DStatus iRet = sHoopsExchangeLoader.Import(sImport);
|
||||
if (iRet != A3D_SUCCESS && iRet != A3D_LOAD_MISSING_COMPONENTS)
|
||||
CHECK_RET(iRet);
|
||||
|
||||
A3DUTF8Char sDstFileNameUTF8[_MAX_PATH];
|
||||
#ifdef _MSC_VER
|
||||
A3DMiscUTF16ToUTF8(acDstFileName, sDstFileNameUTF8);
|
||||
#else
|
||||
MY_STRCPY(sDstFileNameUTF8, acDstFileName);
|
||||
#endif
|
||||
TraverseModel(sHoopsExchangeLoader.m_psModelFile, sDstFileNameUTF8);
|
||||
|
||||
//
|
||||
// ### TERMINATE HOOPS EXCHANGE
|
||||
//
|
||||
|
||||
// Check memory allocations
|
||||
return (int)ListLeaks();
|
||||
}
|
||||
35
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.h
Normal file
35
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef __DUMPFEATURETREE_H__
|
||||
#define __DUMPFEATURETREE_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# pragma warning (disable:4090)
|
||||
# define _CRT_SECURE_NO_DEPRECATE 1
|
||||
# ifdef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
|
||||
# undef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
|
||||
# define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
|
||||
# endif
|
||||
#else
|
||||
#define sprintf_s(buf, buf_size, ...) sprintf((buf), __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#include <tinyxml.h>
|
||||
|
||||
#include <A3DSDKIncludes.h>
|
||||
|
||||
#include "../common.hpp"
|
||||
|
||||
|
||||
#endif //__DUMPFEATURETREE_H__
|
||||
173
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.vcxproj
Normal file
173
exchange/exchangesource/DumpFeatureTree/DumpFeatureTree.vcxproj
Normal file
@@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{693094D2-1470-4AB4-977E-8D82E5985618}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DumpFeatureTree</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>.\TinyXML;.\Visitor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>.\TinyXML;.\Visitor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>.\TinyXML;.\Visitor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>.\TinyXML;.\Visitor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DumpFeatureTree.cpp" />
|
||||
<ClCompile Include="HXFeatureTreeReport.cpp" />
|
||||
<ClCompile Include="HXmlElement.cpp" />
|
||||
<ClCompile Include="HXmlReport.cpp" />
|
||||
<ClCompile Include="TinyXML\tinystr.cpp" />
|
||||
<ClCompile Include="TinyXML\tinyxml.cpp" />
|
||||
<ClCompile Include="TinyXML\tinyxmlerror.cpp" />
|
||||
<ClCompile Include="TinyXML\tinyxmlparser.cpp" />
|
||||
<ClCompile Include="Visitor\TreeTraverse.cpp" />
|
||||
<ClCompile Include="Visitor\VisitorContainer.cpp" />
|
||||
<ClCompile Include="Visitor\VisitorTree.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DumpFeatureTree.h" />
|
||||
<ClInclude Include="HXFeatureTreeReport.h" />
|
||||
<ClInclude Include="HXmlElement.h" />
|
||||
<ClInclude Include="HXmlReport.h" />
|
||||
<ClInclude Include="TinyXML\tinystr.h" />
|
||||
<ClInclude Include="TinyXML\tinyxml.h" />
|
||||
<ClInclude Include="Visitor\Connector.h" />
|
||||
<ClInclude Include="Visitor\TreeTraverse.h" />
|
||||
<ClInclude Include="Visitor\VisitorContainer.h" />
|
||||
<ClInclude Include="Visitor\Visitors.h" />
|
||||
<ClInclude Include="Visitor\VisitorTree.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Visitor">
|
||||
<UniqueIdentifier>{dddc9323-9971-410b-8d07-549bfd7e0b8d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\xml">
|
||||
<UniqueIdentifier>{b1e8e959-6116-4ed9-aef5-0667e7f234ff}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\visitor">
|
||||
<UniqueIdentifier>{af568580-5d33-4492-b589-d06c0aebf16c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\xml">
|
||||
<UniqueIdentifier>{2090204c-e091-4087-94ba-87fc4c177522}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DumpFeatureTree.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TinyXML\tinystr.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TinyXML\tinyxml.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TinyXML\tinyxmlerror.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TinyXML\tinyxmlparser.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HXmlElement.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HXmlReport.cpp">
|
||||
<Filter>Source Files\xml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HXFeatureTreeReport.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Visitor\VisitorContainer.cpp">
|
||||
<Filter>Source Files\Visitor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Visitor\VisitorTree.cpp">
|
||||
<Filter>Source Files\Visitor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Visitor\TreeTraverse.cpp">
|
||||
<Filter>Source Files\Visitor</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DumpFeatureTree.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TinyXML\tinystr.h">
|
||||
<Filter>Header Files\xml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TinyXML\tinyxml.h">
|
||||
<Filter>Header Files\xml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HXmlElement.h">
|
||||
<Filter>Header Files\xml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HXmlReport.h">
|
||||
<Filter>Header Files\xml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HXFeatureTreeReport.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Visitor\TreeTraverse.h">
|
||||
<Filter>Header Files\visitor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Visitor\VisitorContainer.h">
|
||||
<Filter>Header Files\visitor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Visitor\Visitors.h">
|
||||
<Filter>Header Files\visitor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Visitor\VisitorTree.h">
|
||||
<Filter>Header Files\visitor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Visitor\Connector.h">
|
||||
<Filter>Header Files\visitor</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
353
exchange/exchangesource/DumpFeatureTree/FeatureHTML.xsl
Normal file
353
exchange/exchangesource/DumpFeatureTree/FeatureHTML.xsl
Normal file
@@ -0,0 +1,353 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="html" indent="yes" version="4.0"/>
|
||||
|
||||
<xsl:template match="Root">
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
<xsl:text>
|
||||
function showHide(obj){
|
||||
var tbody = obj.parentNode.parentNode.parentNode.getElementsByTagName("tbody")[0];
|
||||
var old = tbody.style.display;
|
||||
tbody.style.display = (old == "none"?"":"none");
|
||||
}
|
||||
</xsl:text>
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
th{
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
table tbody tr td{
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table {
|
||||
border-top: 3px solid grey;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates select="CONTAINER"/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="CONTAINER|CONTAINER_INTERNAL">
|
||||
<xsl:apply-templates select="NODE"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="TYPE">
|
||||
<tr>
|
||||
<th><xsl:value-of select="FEATURE/@Type_type" /></th>
|
||||
<td colspan = "3">
|
||||
<xsl:value-of select="FEATURE/@Value" />
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
<xsl:template match="NODE">
|
||||
<p>
|
||||
<table BORDER = "2">
|
||||
<xsl:for-each select="RootBaseData">
|
||||
<thead>
|
||||
<tr bgcolor="#93B6CD" style="color: white;">
|
||||
<th colspan = "4" onclick="showHide(this)" ><xsl:value-of select="@m_pcName" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</xsl:for-each>
|
||||
<tbody style="display:none">
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
<xsl:for-each select="SPECIFICATION/FeatureMode">
|
||||
<tr>
|
||||
<th>Feature mode</th>
|
||||
<td>
|
||||
<xsl:value-of select="@Value" />
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:apply-templates select="Connection"/>
|
||||
<xsl:apply-templates select="FEATURE_DEFINITION"/>
|
||||
<xsl:if test = "CONTAINER">
|
||||
<tr>
|
||||
<th>CONTAINER</th>
|
||||
<td style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
|
||||
<table BORDER = "1" width="100%">
|
||||
|
||||
<xsl:apply-templates select="CONTAINER"/>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<xsl:if test = "CONTAINER_INTERNAL">
|
||||
<p style="padding: 0px 0px 0px 0px;margin: 0px 0 0 0;">
|
||||
<tr>
|
||||
<th>CONTAINER_INTERNAL</th>
|
||||
<td >
|
||||
<table BORDER = "1" width="100%">
|
||||
<xsl:apply-templates select="CONTAINER_INTERNAL"/>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</p>
|
||||
</xsl:if>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="FEATURE_DEFINITION">
|
||||
<xsl:for-each select="FEATURE">
|
||||
<tr bgcolor="#CEE3F6">
|
||||
<th colspan = "4" ><xsl:value-of select="@feature_definition_type" /></th>
|
||||
</tr>
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="DEFINITION"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="data_text">
|
||||
<xsl:param name="text" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text,',,')">
|
||||
<xsl:value-of select= "substring-before($text,',,')"/>
|
||||
<BR/>
|
||||
<xsl:call-template name="data_text"><xsl:with-param name="text" select="substring-after($text,',,')" /></xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of disable-output-escaping="yes" select="$text" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="DATA">
|
||||
<xsl:for-each select="FEATURE">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@data_type='value'">
|
||||
<tr>
|
||||
<th><xsl:value-of select = "@value_type"/></th>
|
||||
<!--xsl:apply-templates select="DATA"/-->
|
||||
<xsl:choose>
|
||||
<xsl:when test="DATA/FEATURE/@data_type='double'">
|
||||
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="DATA/FEATURE/@data" /></xsl:call-template></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td colspan = "3"><xsl:value-of select = "DATA/FEATURE/@data"/></td>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:when test="@data_type='double'">
|
||||
<tr>
|
||||
<xsl:if test = "@double_type != 'unknown'">
|
||||
<th><xsl:value-of select = "@double_type"/></th>
|
||||
</xsl:if>
|
||||
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="@data" /></xsl:call-template></td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:when test="@data_type='integer'">
|
||||
<tr>
|
||||
<xsl:if test = "@integer_type != 'unknown'">
|
||||
<th><xsl:value-of select = "@integer_type"/></th>
|
||||
</xsl:if>
|
||||
<xsl:if test = "@integer_type != 'boolean'">
|
||||
<td colspan = "3"> <xsl:call-template name="data_text"><xsl:with-param name="text" select="@data" /></xsl:call-template></td>
|
||||
</xsl:if>
|
||||
<xsl:if test = "@integer_type = 'boolean'">
|
||||
<xsl:if test = "@data = '0'">
|
||||
<td colspan = "3"> FALSE</td>
|
||||
</xsl:if>
|
||||
<xsl:if test = "@data = '1'">
|
||||
<td colspan = "3"> TRUE</td>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:when test="@data_type='string'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@string_type='unknown'">
|
||||
<tr><td colspan = "3"><xsl:value-of select = "@data"/></td></tr>
|
||||
</xsl:when>
|
||||
<xsl:when test="@string_type='attribute'">
|
||||
<tr>
|
||||
<td><xsl:value-of select= "substring-before(@data,' xts3dx ')"/></td>
|
||||
<td colspan = "2"><xsl:value-of select= "substring-after(@data,' xts3dx ')"/></td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tr><th><xsl:value-of select = "@string_type"/></th></tr>
|
||||
<tr><td colspan = "3"><xsl:value-of select = "@data"/></td></tr>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="DEFINITION">
|
||||
<xsl:for-each select="FEATURE">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@data_type='definition'">
|
||||
<tr>
|
||||
<th colspan = "4" bgcolor="#E6E6E6" ><xsl:value-of select = "@definition_type"/></th>
|
||||
<!-- <xsl:apply-templates select="Connection/DrawingBlock"/> -->
|
||||
</tr>
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="Connection"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
<xsl:apply-templates select="DEFINITION"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@data_type='definition_pattern'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@definition_pattern_type='InstanceStatus'">
|
||||
<tr >
|
||||
<th>instance status</th><td colspan="3"><xsl:value-of select = ".//@data"/></td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<tr style="padding: 0px 0px 0px 0px; border-collapse: collapse; border-spacing: 0px 0px 0px 0px;">
|
||||
<td colspan = "4" style="padding: 0px 0px 0px 0px; border-collapse: collapse; ">
|
||||
<table BORDER = "1" width="100%" >
|
||||
<thead>
|
||||
<tr >
|
||||
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_pattern_type"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="display:none">
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="Connection"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
<xsl:apply-templates select="DEFINITION"/>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="@data_type='definition_hole'">
|
||||
<tr >
|
||||
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan = "4">
|
||||
<table BORDER = "1" width="100%">
|
||||
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_hole_type"/></th>
|
||||
<tbody style="display:none">
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="Connection"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
<xsl:apply-templates select="DEFINITION"/>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="@data_type='definition_thread'">
|
||||
<tr >
|
||||
<td style="padding: 0px 0px 0px 0px;border-spacing: 0px;" colspan = "4">
|
||||
<table BORDER = "1" width="100%">
|
||||
<th colspan = "4" onclick="showHide(this)" bgcolor="#EFF5FB" ><xsl:value-of select = "@definition_thread_type"/></th>
|
||||
<tbody style="display:none">
|
||||
<xsl:apply-templates select="TYPE"/>
|
||||
<xsl:apply-templates select="Connection"/>
|
||||
<xsl:apply-templates select="DATA"/>
|
||||
<xsl:apply-templates select="DEFINITION"/>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- connection -->
|
||||
<xsl:template match="Connection">
|
||||
<tr bgcolor="#F5F6CE">
|
||||
<th >Link</th>
|
||||
<td> <xsl:value-of select= "@Type"/></td>
|
||||
<xsl:apply-templates select="RootBaseData"/>
|
||||
<xsl:apply-templates select="DrawingBlock/RootBaseData"/>
|
||||
<xsl:apply-templates select="ReferenceOnTopology"/>
|
||||
<xsl:apply-templates select="A3DFRMFeatureLinkedItemConnector"/>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="A3DFRMFeatureLinkedItemConnector">
|
||||
<td>
|
||||
error
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select= "@error"/>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="DrawingBlock">
|
||||
<td colspan = "2">DrawingBlock</td>
|
||||
<!--tr >
|
||||
<th colspan = "2">Entities</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>count</td>
|
||||
<td>
|
||||
<xsl:value-of select= "@Entity_count"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>markup_count</td>
|
||||
<td>
|
||||
<xsl:value-of select= "@Markup_count"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>subblock_count</td>
|
||||
<td>
|
||||
<xsl:value-of select= "@SubBlock_count"/>
|
||||
</td-->
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ReferenceOnTopology">
|
||||
<td>
|
||||
<xsl:value-of select= "@topotype"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select= "face_indexes/@indexes"/>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="RootBaseData">
|
||||
<xsl:if test = "@m_pcName">
|
||||
<td>
|
||||
<xsl:value-of select= "@m_pcName"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select= "@m_uiPersistentId"/>
|
||||
</td>
|
||||
</xsl:if>
|
||||
<xsl:if test = "Connection/DrawingBlock">
|
||||
<td>
|
||||
<xsl:value-of select= "Connection/DrawingBlock/RootBaseData/@m_pcName"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select= "Connection/DrawingBlock/RootBaseData/@m_uiPersistentId"/>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
819
exchange/exchangesource/DumpFeatureTree/HXFeatureTreeReport.cpp
Normal file
819
exchange/exchangesource/DumpFeatureTree/HXFeatureTreeReport.cpp
Normal file
@@ -0,0 +1,819 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <set>
|
||||
#include<sstream>
|
||||
|
||||
#include "HXmlElement.h"
|
||||
#include "HXFeatureTreeReport.h"
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
int traverseIndexes(const A3DUTF8Char* name, const A3DUns32 uiSize, const A3DUns32* pui, TiXmlElement* setting)
|
||||
{
|
||||
|
||||
A3DUns32 gnAllocatedStrings = 0;
|
||||
A3DUTF8Char gbigstring[65536];
|
||||
|
||||
if (uiSize > 0)
|
||||
{
|
||||
A3DUns32 ui = 0;
|
||||
TiXmlElement* uints = new TiXmlElement(name);
|
||||
uints->SetAttribute("size", (int)uiSize);
|
||||
|
||||
// max size of one uint: "%d " 14+1=15
|
||||
A3DUns32 uiFormat = 15;
|
||||
A3DUTF8Char* pc = NULL;
|
||||
size_t uiMaxSize = sizeof(gbigstring)-1;
|
||||
if (uiFormat*uiSize > 65536)
|
||||
{
|
||||
uiMaxSize = size_t(uiSize * uiFormat);
|
||||
pc = (A3DUTF8Char*)malloc((uiMaxSize +1) * sizeof(A3DUTF8Char));
|
||||
pc[0] = 0;
|
||||
gnAllocatedStrings++;
|
||||
}
|
||||
else
|
||||
pc = gbigstring;
|
||||
|
||||
// store temporarily indexes in a set so it is stored in ascending order: useful for non regression tests
|
||||
std::set<A3DUns32> setIndexes;
|
||||
for (ui = 0; ui < uiSize; ++ui)
|
||||
{
|
||||
setIndexes.insert(pui[ui]);
|
||||
}
|
||||
|
||||
size_t uiNext = 0;
|
||||
for (auto const& itSetIndexes : setIndexes)
|
||||
{
|
||||
int iwritten = sprintf_s(pc + uiNext, uiMaxSize - uiNext, "%u ", itSetIndexes);
|
||||
uiNext += size_t(iwritten);
|
||||
}
|
||||
pc[uiNext] = 0;
|
||||
|
||||
uints->SetAttribute("indexes", pc);
|
||||
setting->LinkEndChild(uints);
|
||||
|
||||
if (uiFormat*uiSize > 65536)
|
||||
free(pc);
|
||||
}
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitEnter(const A3DFRMTreeConnector& /*sConnector*/)
|
||||
{
|
||||
m_failed_count = 0;
|
||||
m_non_implemented_node_count = 0;
|
||||
m_non_implemented_subnode_count = 0;
|
||||
m_mandatory_missing_count = 0;
|
||||
m_hole_mandatory_missing_count = 0;
|
||||
m_pattern_mandatory_missing_count = 0;
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitLeave(const A3DFRMTreeConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
void HXFeatureTreeReport::traverseFeatureStatus(const A3DFRMFeatureConnector& sConnector)
|
||||
{
|
||||
if (sConnector.m_sData.m_sType.m_eStatus == kA3DFRMStatus_Failed)
|
||||
{
|
||||
m_sReport.setAttribute("status", "failed");
|
||||
|
||||
}
|
||||
else if (sConnector.m_sData.m_sType.m_eStatus != kA3DFRMStatus_Success)
|
||||
{
|
||||
m_sReport.setAttribute("status", "non_implemented");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HXFeatureTreeReport::traverseFeatureData(const A3DFRMFeatureConnector& sConnector)
|
||||
{
|
||||
A3DFRMIntegerData sIntegerData;
|
||||
A3DFRMDoubleData sDoubleData;
|
||||
A3DFRMStringData sStringData;
|
||||
A3DInt32 iEnumValue;
|
||||
A3DUTF8Char* pcValueAsString = NULL;
|
||||
std::ostringstream s;
|
||||
|
||||
switch (sConnector.m_sData.m_eDataType)
|
||||
{
|
||||
case kA3DFRMDataInteger:
|
||||
A3D_INITIALIZE_DATA(A3DFRMIntegerData, sIntegerData);
|
||||
A3DFRMIntegerDataGet(sConnector.GetA3DEntity(), &sIntegerData);
|
||||
if (sIntegerData.m_uiValuesSize == 0)
|
||||
{
|
||||
m_sReport.setAttribute("data", "empty");
|
||||
A3DFRMIntegerDataGet(NULL, &sIntegerData);
|
||||
return;
|
||||
}
|
||||
s << sIntegerData.m_piValues[0];
|
||||
for (A3DUns32 i = 1; i < sIntegerData.m_uiValuesSize; ++i)
|
||||
{
|
||||
s << ", ";
|
||||
s << sIntegerData.m_piValues[i];
|
||||
if (((i + 1) % 4) == 0)
|
||||
s << ",";
|
||||
}
|
||||
m_sReport.setAttribute("data", s.str().c_str());
|
||||
A3DFRMIntegerDataGet(NULL, &sIntegerData);
|
||||
break;
|
||||
case kA3DFRMDataDouble:
|
||||
A3D_INITIALIZE_DATA(A3DFRMDoubleData, sDoubleData);
|
||||
A3DFRMDoubleDataGet(sConnector.GetA3DEntity(), &sDoubleData);
|
||||
if (sDoubleData.m_uiValuesSize == 0)
|
||||
{
|
||||
m_sReport.setAttribute("data", "empty");
|
||||
A3DFRMDoubleDataGet(NULL, &sDoubleData);
|
||||
return;
|
||||
}
|
||||
s << sDoubleData.m_pdValues[0];
|
||||
for (A3DUns32 i = 1; i < sDoubleData.m_uiValuesSize; ++i)
|
||||
{
|
||||
s << ", ";
|
||||
s << sDoubleData.m_pdValues[i];
|
||||
if (((i + 1) % 4) == 0)
|
||||
s << ",";
|
||||
}
|
||||
m_sReport.setAttribute("data", s.str().c_str());
|
||||
A3DFRMDoubleDataGet(NULL, &sDoubleData);
|
||||
break;
|
||||
case kA3DFRMDataString:
|
||||
A3D_INITIALIZE_DATA(A3DFRMStringData, sStringData);
|
||||
A3DFRMStringDataGet(sConnector.GetA3DEntity(), &sStringData);
|
||||
if (sStringData.m_uiValuesSize == 0)
|
||||
{
|
||||
m_sReport.setAttribute("data", "empty");
|
||||
A3DFRMStringDataGet(NULL, &sStringData);
|
||||
return;
|
||||
}
|
||||
s << sStringData.m_ppcValues[0];
|
||||
for (A3DUns32 i =1; i < sStringData.m_uiValuesSize; ++i)
|
||||
{
|
||||
s << " xts3dx ";
|
||||
if(sStringData.m_ppcValues[i] == nullptr)
|
||||
s << "NULL";
|
||||
else
|
||||
s << sStringData.m_ppcValues[i];
|
||||
}
|
||||
m_sReport.setAttribute("data", s.str().c_str());
|
||||
A3DFRMStringDataGet(NULL, &sStringData);
|
||||
break;
|
||||
case kA3DFRMDataEnum:
|
||||
A3DFRMEnumDataGet(sConnector.GetA3DEntity(), &iEnumValue, &pcValueAsString);
|
||||
if (pcValueAsString)
|
||||
m_sReport.setAttribute("Value", pcValueAsString);
|
||||
else
|
||||
m_sReport.setAttribute("Value", iEnumValue);
|
||||
A3DFRMEnumDataGet(NULL, &iEnumValue, &pcValueAsString);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitEnter(const A3DFRMFeatureConnector& sConnector)
|
||||
{
|
||||
switch (sConnector.m_sData.m_sType.m_eFamily) {
|
||||
case kA3DFamily_Root:
|
||||
{
|
||||
m_sReport.createSubNode("NODE");
|
||||
m_sReport.addNode(traverseRootBaseData(sConnector.GetA3DEntity()));
|
||||
m_sReport.setAttribute("data_type", "root");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMRoot_Node: m_sReport.setAttribute("Root_type", "Node"); break;
|
||||
case kA3DFRMRoot_Container: m_sReport.setAttribute("Root_type", "Container"); break;
|
||||
case kA3DFRMRoot_None:
|
||||
default: m_sReport.setAttribute("Root_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Information:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Type:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "type");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMEnumDataType_CAD: m_sReport.setAttribute("Type_type", "CAD_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_Mode: m_sReport.setAttribute("Type_type", "MODE_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_Depth: m_sReport.setAttribute("Type_type", "DEPTH_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_Pattern: m_sReport.setAttribute("Type_type", "PATTERN_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_HoleShape: m_sReport.setAttribute("Type_type", "HOLE_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_DepthLevel: m_sReport.setAttribute("Type_type", "DEPTH_LEVEL_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_Chamfer: m_sReport.setAttribute("Type_type", "CHAMFER_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_Fillet: m_sReport.setAttribute("Type_type", "FILLET_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_FilletLength: m_sReport.setAttribute("Type_type", "FILLET_LENGTH_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_FilletConic: m_sReport.setAttribute("Type_type", "FILLET_CONIC_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_LengthMode: m_sReport.setAttribute("Type_type", "LENGTH_MODE"); break;
|
||||
case kA3DFRMEnumDataType_PatternMaster: m_sReport.setAttribute("Type_type", "PATTERN_MASTER_TYPE"); break;
|
||||
case kA3DFRMEnumDataType_ReferenceMaster: m_sReport.setAttribute("Type_type", "REFERENCE_MASTER_TYPE"); break;
|
||||
case kA3DFRMDoubleNone:
|
||||
default: m_sReport.setAttribute("Type_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_FeatureDefinition:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "feature_definition");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMFeatureDefinitionType_Hole: m_sReport.setAttribute("feature_definition_type", "Hole"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Pattern: m_sReport.setAttribute("feature_definition_type", "Pattern"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Sketch: m_sReport.setAttribute("feature_definition_type", "Sketch"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Thread: m_sReport.setAttribute("feature_definition_type", "Thread"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Extrude: m_sReport.setAttribute("feature_definition_type", "Extrude"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Revolve: m_sReport.setAttribute("feature_definition_type", "Revolve"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Cosmetic: m_sReport.setAttribute("feature_definition_type", "Cosmetic"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Chamfer: m_sReport.setAttribute("feature_definition_type", "Chamfer"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Fillet: m_sReport.setAttribute("feature_definition_type", "Fillet"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Mirror: m_sReport.setAttribute("feature_definition_type", "Mirror"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Symmetry: m_sReport.setAttribute("feature_definition_type", "Symmetry"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Translate: m_sReport.setAttribute("feature_definition_type", "Translate"); break;
|
||||
case kA3DFRMFeatureDefinitionType_Rotate: m_sReport.setAttribute("feature_definition_type", "Rotate"); break;
|
||||
case kA3DFRMFeatureDefinitionType_None:
|
||||
default: m_sReport.setAttribute("definition_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_DoubleData:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "double");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMDoubleValue: m_sReport.setAttribute("double_type", "value"); break;
|
||||
case kA3DFRMDoubleUnit: m_sReport.setAttribute("double_type", "unit"); break;
|
||||
case kA3DFRMDoubleOffset: m_sReport.setAttribute("double_type", "offset"); break;
|
||||
case kA3DFRMDoubleDepth: m_sReport.setAttribute("double_type", "depth"); break;
|
||||
case kA3DFRMDoubleDiameter: m_sReport.setAttribute("double_type", "diameter"); break;
|
||||
case kA3DFRMDoubleAngle: m_sReport.setAttribute("double_type", "angle"); break;
|
||||
case kA3DFRMDoublePitch: m_sReport.setAttribute("double_type", "pitch"); break;
|
||||
case kA3DFRMDoubleDistance: m_sReport.setAttribute("double_type", "distance"); break;
|
||||
case kA3DFRMDoubleExtensionAndStep: m_sReport.setAttribute("double_type", "extension_and_step"); break;
|
||||
case kA3DFRMDoubleLinearParameter: m_sReport.setAttribute("double_type", "linear_parameter"); break;
|
||||
case kA3DFRMDoubleUVParameter: m_sReport.setAttribute("double_type", "uv_parameter"); break;
|
||||
case kA3DFRMDoubleRadius: m_sReport.setAttribute("double_type", "radius"); break;
|
||||
case kA3DFRMDoubleNone:
|
||||
default: m_sReport.setAttribute("double_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_IntegerData:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "integer");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMIntegerDataValue: m_sReport.setAttribute("integer_type", "value"); break;
|
||||
case kA3DFRMIntegerDataBoolean: m_sReport.setAttribute("integer_type", "boolean"); break;
|
||||
case kA3DFRMIntegerDataIndex: m_sReport.setAttribute("integer_type", "index"); break;
|
||||
case kA3DFRMIntegerDataKeepSpecification: m_sReport.setAttribute("integer_type", "KeepSpecification"); break;
|
||||
case kA3DFRMIntegerDataRadialAlignment: m_sReport.setAttribute("integer_type", "RadialAlignment"); break;
|
||||
case kA3DFRMIntegerDataClockwise: m_sReport.setAttribute("integer_type", "Clockwise"); break;
|
||||
case kA3DFRMIntegerDataId: m_sReport.setAttribute("integer_type", "id"); break;
|
||||
case kA3DFRMIntegerDataFlip: m_sReport.setAttribute("integer_type", "flip"); break;
|
||||
case kA3DFRMIntegerDataType: m_sReport.setAttribute("integer_type", "type"); break;
|
||||
case kA3DFRMIntegerDataCount: m_sReport.setAttribute("integer_type", "count"); break;
|
||||
case kA3DFRMIntegerDataSize: m_sReport.setAttribute("integer_type", "size"); break;
|
||||
case kA3DFRMIntegerDataNbStart: m_sReport.setAttribute("integer_type", "NbStart"); break;
|
||||
case kA3DFRMIntegerDataNone:
|
||||
default: m_sReport.setAttribute("integer_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_StringData:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "string");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMStringDataName: m_sReport.setAttribute("string_type", "name"); break;
|
||||
case kA3DFRMStringDataAttribute: m_sReport.setAttribute("string_type", "attribute"); break;
|
||||
case kA3DFRMStringDataType: m_sReport.setAttribute("string_type", "type"); break;
|
||||
case kA3DFRMStringDataValue: m_sReport.setAttribute("string_type", "value"); break;
|
||||
case kA3DFRMStringDataNone:
|
||||
default: m_sReport.setAttribute("double_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Value:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "value");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMValueType_Length: m_sReport.setAttribute("value_type", "Length"); break;
|
||||
case kA3DFRMValueType_Angle: m_sReport.setAttribute("value_type", "Angle"); break;
|
||||
case kA3DFRMValueType_Diameter: m_sReport.setAttribute("value_type", "Diameter"); break;
|
||||
case kA3DFRMValueType_Radius: m_sReport.setAttribute("value_type", "Radius"); break;
|
||||
case kA3DFRMValueType_Depth: m_sReport.setAttribute("value_type", "Depth"); break;
|
||||
case kA3DFRMValueType_Thickness: m_sReport.setAttribute("value_type", "Thickness"); break;
|
||||
case kA3DFRMValueType_Offset: m_sReport.setAttribute("value_type", "Offset"); break;
|
||||
case kA3DFRMValueType_Distance: m_sReport.setAttribute("value_type", "Distance"); break;
|
||||
case kA3DFRMValueType_Coords: m_sReport.setAttribute("value_type", "Coords"); break;
|
||||
case kA3DFRMValueType_Vector: m_sReport.setAttribute("value_type", "Vector"); break;
|
||||
case kA3DFRMValueType_Matrix: m_sReport.setAttribute("value_type", "Matrix"); break;
|
||||
case kA3DFRMValueType_Area: m_sReport.setAttribute("value_type", "Area"); break;
|
||||
case kA3DFRMValueType_Volume: m_sReport.setAttribute("value_type", "Volume"); break;
|
||||
case kA3DFRMValueType_Mass: m_sReport.setAttribute("value_type", "Mass"); break;
|
||||
case kA3DFRMValueType_Time: m_sReport.setAttribute("value_type", "Time"); break;
|
||||
case kA3DFRMStringDataNone:
|
||||
default: m_sReport.setAttribute("double_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Definition:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "definition");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMDefinitionType_Depth: m_sReport.setAttribute("definition_type", "Depth"); break;
|
||||
case kA3DFRMDefinitionType_DepthFrom: m_sReport.setAttribute("definition_type", "DepthFrom"); break;
|
||||
case kA3DFRMDefinitionType_Position: m_sReport.setAttribute("definition_type", "Position"); break;
|
||||
case kA3DFRMDefinitionType_Direction: m_sReport.setAttribute("definition_type", "Direction"); break;
|
||||
case kA3DFRMDefinitionType_Thread: m_sReport.setAttribute("definition_type", "Thread"); break;
|
||||
case kA3DFRMDefinitionType_Shape: m_sReport.setAttribute("definition_type", "Shape"); break;
|
||||
case kA3DFRMDefinitionType_Reference: m_sReport.setAttribute("definition_type", "Reference"); break;
|
||||
case kA3DFRMDefinitionType_Sketch: m_sReport.setAttribute("definition_type", "Sketch"); break;
|
||||
case kA3DFRMDefinitionType_RevolveAngle: m_sReport.setAttribute("definition_type", "RevolveAngle"); break;
|
||||
case kA3DFRMDefinitionType_RevolveAngleFrom: m_sReport.setAttribute("definition_type", "RevolveAngleFrom"); break;
|
||||
case kA3DFRMDefinitionType_Axis: m_sReport.setAttribute("definition_type", "Axis"); break;
|
||||
case kA3DFRMDefinitionType_Chamfer: m_sReport.setAttribute("definition_type", "Values"); break;
|
||||
case kA3DFRMDefinitionType_FilletLength: m_sReport.setAttribute("definition_type", "FilletLength"); break;
|
||||
case kA3DFRMDefinitionType_ReferenceMaster: m_sReport.setAttribute("definition_type", "ReferenceMaster"); break;
|
||||
case kA3DFRMDefinitionType_None:
|
||||
default: m_sReport.setAttribute("definition_type", "unknown"); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Definition_Hole:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "definition_hole");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMDefinitionHoleType_RectangularDefinition: m_sReport.setAttribute("definition_hole_type", "RectangularDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_ChamferDefinition: m_sReport.setAttribute("definition_hole_type", "ChamferDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_CboreDefinition: m_sReport.setAttribute("definition_hole_type", "CboreDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_SunkDefinition: m_sReport.setAttribute("definition_hole_type", "SunkDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_TaperedDefinition: m_sReport.setAttribute("definition_hole_type", "TaperedDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_StandardDefinition: m_sReport.setAttribute("definition_hole_type", "StandardDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_ElementDefinition: m_sReport.setAttribute("definition_hole_type", "ElementDefinition"); break;
|
||||
case kA3DFRMDefinitionHoleType_None:
|
||||
default: m_sReport.setAttribute("definition_hole_type", "unknown"); break;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Definition_Pattern:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "definition_pattern");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMDefinitionPatternType_PatternMaster: m_sReport.setAttribute("definition_pattern_type", "PatternMaster"); break;
|
||||
case kA3DFRMDefinitionPatternType_PolygonalShape: m_sReport.setAttribute("definition_pattern_type", "PolygonalShape"); break;
|
||||
case kA3DFRMDefinitionPatternType_SpiralShape: m_sReport.setAttribute("definition_pattern_type", "SpiralShape"); break;
|
||||
case kA3DFRMDefinitionPatternType_DirectionSpacing: m_sReport.setAttribute("definition_pattern_type", "DirectionSpacing"); break;
|
||||
case kA3DFRMDefinitionPatternType_AxialSpacing: m_sReport.setAttribute("definition_pattern_type", "AxialSpacing"); break;
|
||||
case kA3DFRMDefinitionPatternType_RadialSpacing: m_sReport.setAttribute("definition_pattern_type", "RadialSpacing"); break;
|
||||
case kA3DFRMDefinitionPatternType_PolygonalSpacing: m_sReport.setAttribute("definition_pattern_type", "PolygonalSpacing"); break;
|
||||
case kA3DFRMDefinitionPatternType_SpiralSpacing: m_sReport.setAttribute("definition_pattern_type", "SpiralSpacing"); break;
|
||||
case kA3DFRMDefinitionPatternType_InstanceStatus: m_sReport.setAttribute("definition_pattern_type", "InstanceStatus"); break;
|
||||
case kA3DFRMDefinitionPatternType_InstanceInformation:m_sReport.setAttribute("definition_pattern_type", "InstanceInformation"); break;
|
||||
case kA3DFRMDefinitionPatternType_None:
|
||||
default: m_sReport.setAttribute("definition_pattern_type", "unknown"); break;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kA3DFamily_Definition_Thread:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "definition_thread");
|
||||
switch (sConnector.m_sData.m_sType.m_uiType) {
|
||||
case kA3DFRMDefinitionThreadType_Undercut: m_sReport.setAttribute("definition_thread_type", "Undercut"); break;
|
||||
case kA3DFRMDefinitionThreadType_Shaft: m_sReport.setAttribute("definition_thread_type", "Shaft"); break;
|
||||
case kA3DFRMDefinitionThreadType_None:
|
||||
default: m_sReport.setAttribute("definition_thread_type", "unknown"); break;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE");
|
||||
m_sReport.setAttribute("data_type", "unknown");
|
||||
}
|
||||
}
|
||||
traverseFeatureStatus(sConnector);
|
||||
traverseFeatureData(sConnector);
|
||||
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitLeave(const A3DFRMFeatureConnector& /*sConnector*/)
|
||||
{
|
||||
m_sReport.closeSubNode();
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
HXmlElement* HXFeatureTreeReport::traverseA3DMiscReferenceOnTessData(const A3DMiscEntityReference* pEntityReference)
|
||||
{
|
||||
A3DMiscReferenceOnTessData sReferenceOnTessData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTessData, sReferenceOnTessData);
|
||||
if (A3DMiscReferenceOnTessGet(pEntityReference, &sReferenceOnTessData) != A3D_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
HXmlElement* pXmlReferenceOnTess = new HXmlElement("ReferenceOnTess");
|
||||
|
||||
pXmlReferenceOnTess->SetAttribute("topotype", "Face");
|
||||
if (sReferenceOnTessData.m_uiSize == 0)
|
||||
pXmlReferenceOnTess->SetAttribute("ref_count", "error");
|
||||
|
||||
for (A3DUns32 iFace = 0; iFace < sReferenceOnTessData.m_uiSize; iFace++)
|
||||
pXmlReferenceOnTess->SetAttribute("face_indice", sReferenceOnTessData.m_puiAdditionalIndexes[iFace]);
|
||||
|
||||
A3DMiscReferenceOnTessGet(NULL, &sReferenceOnTessData);
|
||||
|
||||
return pXmlReferenceOnTess;
|
||||
}
|
||||
|
||||
|
||||
HXmlElement* HXFeatureTreeReport::traverseA3DMiscReferenceOnCsysItem(const A3DMiscReferenceOnCsysItem* pEntityReference)
|
||||
{
|
||||
HXmlElement* pXmlReferenceOnCsysItem = new HXmlElement("ReferenceOnCsysItem");
|
||||
|
||||
A3DMiscReferenceOnCsysItemData sA3DMiscReferenceOnCSYSITemData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnCsysItemData, sA3DMiscReferenceOnCSYSITemData);
|
||||
A3DStatus iRet = A3DMiscReferenceOnCsysItemGet(pEntityReference, &sA3DMiscReferenceOnCSYSITemData);
|
||||
if (iRet != A3D_SUCCESS || !sA3DMiscReferenceOnCSYSITemData.m_pCoordinateSystem)
|
||||
{
|
||||
pXmlReferenceOnCsysItem->SetAttribute("error_A3DMiscReferenceOnCsysItemGet", iRet);
|
||||
return pXmlReferenceOnCsysItem;
|
||||
}
|
||||
A3DRootBaseData sCSYSRootData;
|
||||
A3D_INITIALIZE_DATA(A3DRootBaseData, sCSYSRootData);
|
||||
if (A3DRootBaseGet(sA3DMiscReferenceOnCSYSITemData.m_pCoordinateSystem, &sCSYSRootData) == A3D_SUCCESS)
|
||||
{
|
||||
pXmlReferenceOnCsysItem->SetAttribute("cys_name", (sCSYSRootData.m_pcName && sCSYSRootData.m_pcName[0] != '\0') ? sCSYSRootData.m_pcName : "NULL");
|
||||
pXmlReferenceOnCsysItem->SetAttribute("index", sA3DMiscReferenceOnCSYSITemData.m_uiIndex);
|
||||
A3DRootBaseGet(NULL,&sCSYSRootData);
|
||||
}
|
||||
return pXmlReferenceOnCsysItem;
|
||||
}
|
||||
|
||||
HXmlElement* HXFeatureTreeReport::traverseReferenceOnTopology(const A3DMiscReferenceOnTopology* pEntityReference)
|
||||
{
|
||||
A3DMiscReferenceOnTopologyData sReferenceOnTopologyData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTopologyData, sReferenceOnTopologyData);
|
||||
HXmlElement* pXmReferenceOnTopology = new HXmlElement("ReferenceOnTopology");
|
||||
if (A3DMiscReferenceOnTopologyGet((A3DMiscReferenceOnTopology*)pEntityReference, &sReferenceOnTopologyData) != A3D_SUCCESS)
|
||||
{
|
||||
pXmReferenceOnTopology->SetAttribute("error", "A3DMiscReferenceOnTopologyGet");
|
||||
return pXmReferenceOnTopology;
|
||||
}
|
||||
A3DUns32 i = 0;
|
||||
char acName[255];
|
||||
switch (sReferenceOnTopologyData.m_eTopoItemType)
|
||||
{
|
||||
case kA3DTypeTopoEdge:
|
||||
pXmReferenceOnTopology->SetAttribute("topo_type", "Edge");
|
||||
if (!(sReferenceOnTopologyData.m_uiSize != 3))
|
||||
{
|
||||
pXmReferenceOnTopology->SetAttribute("ref_count", "error");
|
||||
break;
|
||||
}
|
||||
while (i + 2 < sReferenceOnTopologyData.m_uiSize)
|
||||
{
|
||||
sprintf_s(acName, sizeof(acName)-1,"%d %d %d",
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+1],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+2]);
|
||||
pXmReferenceOnTopology->SetAttribute("face/loop/edge indexes", acName);
|
||||
i+=3;
|
||||
}
|
||||
break;
|
||||
case kA3DTypeTopoCoEdge:
|
||||
pXmReferenceOnTopology->SetAttribute("topotype", "CoEdge");
|
||||
if (!(sReferenceOnTopologyData.m_uiSize % 3))
|
||||
{
|
||||
pXmReferenceOnTopology->SetAttribute("ref_count", "error");
|
||||
break;
|
||||
}
|
||||
while (i + 2 < sReferenceOnTopologyData.m_uiSize)
|
||||
{
|
||||
sprintf_s(acName, sizeof(acName) - 1, "%d %d %d",
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+1],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+2]);
|
||||
pXmReferenceOnTopology->SetAttribute("face/loop/coedge indexes", acName);
|
||||
i+=3;
|
||||
}
|
||||
break;
|
||||
case kA3DTypeTopoFace:
|
||||
pXmReferenceOnTopology->SetAttribute("topotype", "Face");
|
||||
traverseIndexes("face_indexes", sReferenceOnTopologyData.m_uiSize, sReferenceOnTopologyData.m_puiAdditionalIndexes, pXmReferenceOnTopology);
|
||||
break;
|
||||
case kA3DTypeTopoUniqueVertex:
|
||||
pXmReferenceOnTopology->SetAttribute("topotype", "Unique Vertex");
|
||||
if (!(sReferenceOnTopologyData.m_uiSize %= 4))
|
||||
{
|
||||
pXmReferenceOnTopology->SetAttribute("ref_count", "error");
|
||||
break;
|
||||
}
|
||||
while (i + 3 < sReferenceOnTopologyData.m_uiSize)
|
||||
{
|
||||
sprintf_s(acName, sizeof(acName) - 1, "%d %d %d %d",
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+1],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+2],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+3]);
|
||||
pXmReferenceOnTopology->SetAttribute("face/loop/edge/vertex indexes", acName);
|
||||
i+=4;
|
||||
}
|
||||
break;
|
||||
case kA3DTypeTopoMultipleVertex:
|
||||
pXmReferenceOnTopology->SetAttribute("topotype", "Multiple Vertex");
|
||||
if (!(sReferenceOnTopologyData.m_uiSize % 4 != 0))
|
||||
{
|
||||
pXmReferenceOnTopology->SetAttribute("ref_count", "error");
|
||||
break;
|
||||
}
|
||||
while (i + 3 < sReferenceOnTopologyData.m_uiSize)
|
||||
{
|
||||
sprintf_s(acName, sizeof(acName) - 1, "%d %d %d %d",
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+1],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+2],
|
||||
sReferenceOnTopologyData.m_puiAdditionalIndexes[i+3]);
|
||||
pXmReferenceOnTopology->SetAttribute("face/loop/edge/vertex indexes", acName);
|
||||
i+=4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
pXmReferenceOnTopology->SetAttribute("linked_item_topo_reference", "unexpected");
|
||||
break;
|
||||
}
|
||||
A3DMiscReferenceOnTopologyGet(NULL,&sReferenceOnTopologyData);
|
||||
return pXmReferenceOnTopology;
|
||||
}
|
||||
|
||||
|
||||
void HXFeatureTreeReport::traverseDrawingBlock(const A3DDrawingBlockBasic *pDrwBlock)
|
||||
{
|
||||
A3DInt32 iRet = A3D_SUCCESS;
|
||||
|
||||
A3DDrawingBlockBasicData sDrwBlockData;
|
||||
A3D_INITIALIZE_DATA(A3DDrawingBlockBasicData, sDrwBlockData);
|
||||
|
||||
m_sReport.createSubNode("DrawingBlock");
|
||||
|
||||
if ((iRet = A3DDrawingBlockBasicGet((A3DDrawingBlockBasic const*)pDrwBlock, &sDrwBlockData)) == A3D_SUCCESS)
|
||||
{
|
||||
m_sReport.addNode(traverseRootBaseData(pDrwBlock));
|
||||
m_sReport.setAttribute("Entity_count", (int)sDrwBlockData.m_uiDrwEntitiesSize);
|
||||
m_sReport.setAttribute("Markup_count", (int)sDrwBlockData.m_uiMarkupsSize);
|
||||
m_sReport.setAttribute("SubBlock_count", (int)sDrwBlockData.m_uiDrwBlocksSize);
|
||||
|
||||
m_sReport.createSubNode("Subblock");
|
||||
{
|
||||
for (A3DUns32 ui = 0; ui < sDrwBlockData.m_uiDrwBlocksSize; ++ui)
|
||||
traverseDrawingBlock(sDrwBlockData.m_ppDrwBlocks[ui]);
|
||||
}
|
||||
m_sReport.closeSubNode();
|
||||
A3DDrawingBlockBasicGet(NULL,&sDrwBlockData);
|
||||
}
|
||||
m_sReport.closeSubNode();
|
||||
}
|
||||
|
||||
void HXFeatureTreeReport::traverseEntityReference(const A3DEntity* pEntityReference)
|
||||
{
|
||||
A3DInt32 iRet = A3D_SUCCESS;
|
||||
A3DMiscEntityReferenceData sData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscEntityReferenceData, sData);
|
||||
|
||||
A3DEEntityType eType = kA3DTypeUnknown;
|
||||
iRet = A3DEntityGetType(pEntityReference, &eType);
|
||||
if (iRet != A3D_SUCCESS)
|
||||
{
|
||||
HXmlElement* entityreference = new HXmlElement("A3DEntityGetType");
|
||||
entityreference->SetAttribute("error", iRet);
|
||||
m_sReport.addNode(entityreference);
|
||||
}
|
||||
|
||||
if (eType == kA3DTypeMiscReferenceOnTopology)
|
||||
{
|
||||
m_sReport.addNode(traverseReferenceOnTopology(pEntityReference));
|
||||
}
|
||||
else if (eType == kA3DTypeMiscReferenceOnCsysItem)
|
||||
{
|
||||
m_sReport.addNode(traverseA3DMiscReferenceOnCsysItem(pEntityReference));
|
||||
}
|
||||
else if (eType == kA3DTypeFRMFeature)
|
||||
{
|
||||
m_sReport.addNode(traverseRootBaseData(pEntityReference));
|
||||
}
|
||||
else if (eType == kA3DTypeDrawingBlockBasic)
|
||||
{
|
||||
traverseDrawingBlock((const A3DDrawingBlockBasic *)pEntityReference);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sReport.addNode(traverseRootBaseData(pEntityReference));
|
||||
|
||||
if (eType == kA3DTypeRiPolyBrepModel)
|
||||
{
|
||||
m_sReport.addNode(traverseA3DMiscReferenceOnTessData(pEntityReference));
|
||||
}
|
||||
else if (eType == kA3DTypeRiPlane)
|
||||
{
|
||||
A3DMiscMarkupLinkedItem* pLinkedItem = NULL;
|
||||
A3DRiPlaneSupportGet((const A3DRiPlane*)pEntityReference, &pLinkedItem);
|
||||
if (pLinkedItem)
|
||||
{
|
||||
m_sReport.createSubNode("SUPPORT");
|
||||
{
|
||||
iRet = A3DMiscEntityReferenceGet(pLinkedItem, &sData);
|
||||
if (iRet != A3D_SUCCESS || sData.m_pEntity == NULL)
|
||||
{
|
||||
HXmlElement* entityreference = new HXmlElement("A3DMiscEntityReferenceGet");
|
||||
entityreference->SetAttribute("error", iRet);
|
||||
m_sReport.addNode(entityreference);
|
||||
}
|
||||
traverseEntityReference(sData.m_pEntity);
|
||||
m_sReport.closeSubNode();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (eType == kA3DTypeRiCurve)
|
||||
{
|
||||
A3DMiscMarkupLinkedItem* pLinkedItem = NULL;
|
||||
A3DRiCurveSupportGet((const A3DRiCurve*)pEntityReference, &pLinkedItem);
|
||||
if (pLinkedItem)
|
||||
{
|
||||
m_sReport.createSubNode("SUPPORT");
|
||||
{
|
||||
iRet = A3DMiscEntityReferenceGet(pLinkedItem, &sData);
|
||||
if (iRet != A3D_SUCCESS || sData.m_pEntity == NULL)
|
||||
{
|
||||
HXmlElement* entityreference = new HXmlElement("A3DMiscEntityReferenceGet");
|
||||
entityreference->SetAttribute("error", iRet);
|
||||
m_sReport.addNode(entityreference);
|
||||
}
|
||||
traverseEntityReference(sData.m_pEntity);
|
||||
m_sReport.closeSubNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
A3DMiscEntityReferenceGet(NULL, &sData);
|
||||
|
||||
|
||||
}
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitEnter(const A3DFRMLinkedItemConnector& sConnector)
|
||||
{
|
||||
m_sReport.createSubNode("Connection");
|
||||
switch (sConnector.m_sData.m_eType)
|
||||
{
|
||||
case kA3DFRMLink_Outcome:
|
||||
m_sReport.setAttribute("Type", "Outcome");
|
||||
break;
|
||||
case kA3DFRMLink_Construction:
|
||||
m_sReport.setAttribute("Type", "Construction");
|
||||
break;
|
||||
case kA3DFRMLink_Position:
|
||||
m_sReport.setAttribute("Type", "Position");
|
||||
break;
|
||||
case kA3DFRMLink_Support:
|
||||
m_sReport.setAttribute("Type", "Support");
|
||||
break;
|
||||
default:
|
||||
m_sReport.setAttribute("Type", "Unknown");
|
||||
break;
|
||||
}
|
||||
if (sConnector.m_sData.m_pReference)
|
||||
traverseEntityReference(sConnector.m_sData.m_pReference);
|
||||
else
|
||||
{
|
||||
HXmlElement* entityreference = new HXmlElement("A3DFRMFeatureLinkedItemConnector");
|
||||
entityreference->SetAttribute("error", "no reference");
|
||||
m_sReport.addNode(entityreference);
|
||||
}
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
A3DStatus HXFeatureTreeReport::visitLeave(const A3DFRMLinkedItemConnector& /*sConnector*/)
|
||||
{
|
||||
m_sReport.closeSubNode();
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitEnter(const A3DFRMParameterConnector& sConnector)
|
||||
{
|
||||
switch (sConnector.m_sData.m_eType)
|
||||
{
|
||||
case kA3DParameterType_None:
|
||||
{
|
||||
m_sReport.createSubNode("ROOT");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Information:
|
||||
{
|
||||
m_sReport.createSubNode("INFORMATION");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Type:
|
||||
{
|
||||
m_sReport.createSubNode("TYPE");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Specification:
|
||||
{
|
||||
m_sReport.createSubNode("SPECIFICATION");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_FeatureDefinition:
|
||||
{
|
||||
m_sReport.createSubNode("FEATURE_DEFINITION");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Definition:
|
||||
{
|
||||
m_sReport.createSubNode("DEFINITION");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Container:
|
||||
{
|
||||
m_sReport.createSubNode("CONTAINER");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_ContainerInternal:
|
||||
{
|
||||
m_sReport.createSubNode("CONTAINER_INTERNAL");
|
||||
break;
|
||||
}
|
||||
case kA3DParameterType_Data:
|
||||
{
|
||||
m_sReport.createSubNode("DATA");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
m_sReport.createSubNode("PARAMETER");
|
||||
break;
|
||||
}
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus HXFeatureTreeReport::visitLeave(const A3DFRMParameterConnector& /*sConnector*/)
|
||||
{
|
||||
m_sReport.closeSubNode();
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
HXmlElement* HXFeatureTreeReport::traverseRootBaseData(const A3DEntity* pEntity)
|
||||
{
|
||||
A3DRootBaseData sRBData;
|
||||
A3D_INITIALIZE_DATA(A3DRootBaseData, sRBData);
|
||||
A3DStatus iRet2 = A3DRootBaseGet(pEntity, &sRBData);
|
||||
if (iRet2 != A3D_SUCCESS)
|
||||
return NULL;
|
||||
HXmlElement* pXmlRootBaseData = new HXmlElement("RootBaseData");
|
||||
if (sRBData.m_pcName && sRBData.m_pcName[0] != '\0')
|
||||
pXmlRootBaseData->SetAttribute("m_pcName", sRBData.m_pcName);
|
||||
|
||||
pXmlRootBaseData->SetAttribute("m_uiPersistentId", sRBData.m_uiPersistentId);
|
||||
pXmlRootBaseData->SetAttribute("m_uiNonPersistentId", sRBData.m_uiNonPersistentId);
|
||||
A3DRootBaseGet(NULL, &sRBData);
|
||||
return pXmlRootBaseData;
|
||||
}
|
||||
|
||||
|
||||
bool HXFeatureTreeReport::isAlreadyTreadted(const A3DFRMFeatureConnector& sFeature)
|
||||
{
|
||||
std::vector<const A3DEntity*>::iterator feature = m_apAlreadyparsedFeatures.begin();
|
||||
for (; feature != m_apAlreadyparsedFeatures.end(); ++feature) {
|
||||
if (*feature == sFeature.GetA3DEntity())
|
||||
return FALSE;
|
||||
}
|
||||
m_apAlreadyparsedFeatures.push_back(sFeature.GetA3DEntity());
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
#pragma once
|
||||
#ifndef __HTREEDUMP_H__
|
||||
#define __HTREEDUMP_H__
|
||||
|
||||
#include "Visitors.h"
|
||||
#include "tinyxml.h"
|
||||
#include "HXmlReport.h"
|
||||
|
||||
class HXFeatureTreeReport: public A3DVisitor
|
||||
{
|
||||
public:
|
||||
HXFeatureTreeReport(A3DVisitorContainer* pContainer):
|
||||
A3DVisitor("FeatureTreeReport", pContainer),
|
||||
m_failed_count(0),
|
||||
m_non_implemented_node_count(0),
|
||||
m_non_implemented_subnode_count(0),
|
||||
m_mandatory_missing_count(0),
|
||||
m_hole_mandatory_missing_count(0),
|
||||
m_pattern_mandatory_missing_count(0)
|
||||
{}
|
||||
virtual ~HXFeatureTreeReport() {}
|
||||
|
||||
inline void SaveFile(const A3DUTF8Char* pcReportPath) { m_sReport.SaveFile(pcReportPath, "FeatureHTML.xsl"); }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMTreeConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMTreeConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMParameterConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMParameterConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMFeatureConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMFeatureConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMLinkedItemConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMLinkedItemConnector& sConnector);
|
||||
|
||||
private:
|
||||
int m_failed_count;
|
||||
int m_non_implemented_node_count;
|
||||
int m_non_implemented_subnode_count;
|
||||
int m_mandatory_missing_count;
|
||||
int m_hole_mandatory_missing_count;
|
||||
int m_pattern_mandatory_missing_count;
|
||||
HXmlReport m_sReport;
|
||||
std::vector<const A3DEntity*> m_apAlreadyparsedFeatures;
|
||||
|
||||
bool isAlreadyTreadted(const A3DFRMFeatureConnector& sFeature);
|
||||
|
||||
HXmlElement* traverseRootBaseData(const A3DEntity* pEntity);
|
||||
HXmlElement* traverseReferenceOnTopology(const A3DMiscReferenceOnTopology* pEntityReference);
|
||||
HXmlElement* traverseA3DMiscReferenceOnCsysItem(const A3DMiscReferenceOnCsysItem* pEntityReference);
|
||||
HXmlElement* traverseA3DMiscReferenceOnTessData(const A3DMiscEntityReference* pEntityReference);
|
||||
|
||||
void traverseEntityReference(const A3DEntity* pEntityReference);
|
||||
void traverseDrawingBlock(const A3DDrawingBlockBasic* pEntityReference);
|
||||
void traverseFeatureStatus(const A3DFRMFeatureConnector& sFeature);
|
||||
void traverseFeatureData(const A3DFRMFeatureConnector& sFeature);
|
||||
};
|
||||
|
||||
#endif // __HTREEDUMP_H__
|
||||
164
exchange/exchangesource/DumpFeatureTree/HXmlElement.cpp
Normal file
164
exchange/exchangesource/DumpFeatureTree/HXmlElement.cpp
Normal file
@@ -0,0 +1,164 @@
|
||||
#include "HXmlElement.h"
|
||||
|
||||
#ifdef COMPUTE_RTF_STRING
|
||||
#include <A3DSDKIncludes.h>
|
||||
#endif
|
||||
|
||||
HXmlElement* HXmlElement::add_element( const char* pcText)
|
||||
{
|
||||
HXmlElement* psElement = new HXmlElement(pcText);
|
||||
this->LinkEndChild( psElement);
|
||||
return psElement;
|
||||
}
|
||||
HXmlElement* HXmlElement::add_element_with_id( const char* pcText, const char* pcTextId)
|
||||
{
|
||||
HXmlElement* psElement = new HXmlElement(pcText);
|
||||
this->LinkEndChild( psElement);
|
||||
psElement->SetAttribute("id", pcTextId);
|
||||
return psElement;
|
||||
}
|
||||
HXmlElement* HXmlElement::add_header( const char* pcText)
|
||||
{
|
||||
HXmlElement* psElementHeader = this->add_element("h2");
|
||||
psElementHeader->LinkEndChild( new TiXmlText(pcText));
|
||||
return psElementHeader;
|
||||
}
|
||||
#ifdef COMPUTE_RTF_STRING
|
||||
void HXmlElement::add_value( const char* pcValue, bool bRTF)
|
||||
{
|
||||
if(bRTF == false)
|
||||
{
|
||||
this->LinkEndChild( new TiXmlText(pcValue));
|
||||
}
|
||||
char acAttributValue[1024];
|
||||
//A3DVoid* pRTFData = NULL;
|
||||
A3DUTF8Char* pRTFString = (A3DUTF8Char*)pcValue;
|
||||
A3DMkpRTFField* pRTF = NULL;
|
||||
|
||||
if (A3DMkpRTFFieldCreate(pRTFString, &pRTF) == A3D_SUCCESS)
|
||||
{
|
||||
A3DMkpRTFFieldData sRTFFieldData;
|
||||
A3D_INITIALIZE_DATA(A3DRTFFieldData, sRTFFieldData);
|
||||
|
||||
//add_element( "rtf - ");
|
||||
while (A3DMkpRTFFieldGet(pRTF, &sRTFFieldData) == A3D_SUCCESS)
|
||||
{
|
||||
if(sRTFFieldData.m_pcFamilyName)
|
||||
sprintf(acAttributValue, "font-family:%s;", sRTFFieldData.m_pcFamilyName);
|
||||
this->SetAttribute("style", acAttributValue);
|
||||
this->LinkEndChild(new TiXmlText(sRTFFieldData.m_pcText));
|
||||
|
||||
A3DMkpRTFFieldGet(NULL, &sRTFFieldData);
|
||||
}
|
||||
//add_element( " -");
|
||||
|
||||
A3DMkpRTFFieldDelete(pRTF);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void HXmlElement::add_value( const char* pcValue, bool /*bRTF*/)
|
||||
{
|
||||
this->LinkEndChild( new TiXmlText(pcValue));
|
||||
}
|
||||
#endif
|
||||
|
||||
void HXmlElement::add_value(double dValue, int idecimal)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue,sizeof(acValue), "%.*f", idecimal, dValue);
|
||||
return add_value(acValue);
|
||||
}
|
||||
void HXmlElement::add_value(int iValue)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), " %d", iValue);
|
||||
return add_value(acValue);
|
||||
}
|
||||
HXmlElement* HXmlElement::add_element_and_value( char* pcText, const char* pcValue, bool bRTF)
|
||||
{
|
||||
HXmlElement* psElement = new HXmlElement(pcText);
|
||||
psElement->add_value( pcValue, bRTF);
|
||||
//psElement->LinkEndChild( new TiXmlText(pcValue));
|
||||
this->LinkEndChild( psElement);
|
||||
return psElement;
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_element_and_value( char* pcText, double dValue)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%f", dValue);
|
||||
return add_element_and_value( pcText, acValue);
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_element_and_value( char* pcText, int iValue)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%d", iValue);
|
||||
return add_element_and_value( pcText, acValue);
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_element_and_value( char* pcText, double dValue, int idecimal)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%.*f", idecimal, dValue);
|
||||
return add_element_and_value( pcText, acValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HXmlTableRow::add_cell( char* pcText, int span_count)
|
||||
{
|
||||
TiXmlElement* psCell = add_element( "TD");
|
||||
psCell->LinkEndChild( new TiXmlText(pcText));
|
||||
char acValue[1024];
|
||||
if(span_count>0)
|
||||
{
|
||||
snprintf(acValue, sizeof(acValue), "%d", span_count);
|
||||
psCell->SetAttribute("rowspan", acValue);
|
||||
}
|
||||
else if(span_count<0)
|
||||
{
|
||||
snprintf(acValue, sizeof(acValue), "%d", -1*span_count);
|
||||
psCell->SetAttribute("colspan", acValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HXmlTableRow::add_cell( char* pcText, int row_span, int col_span)
|
||||
{
|
||||
TiXmlElement* psCell = add_element( "TD");
|
||||
psCell->LinkEndChild( new TiXmlText(pcText));
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%d", row_span);
|
||||
psCell->SetAttribute("rowspan", acValue);
|
||||
snprintf(acValue, sizeof(acValue), "%d", col_span);
|
||||
psCell->SetAttribute("colspan", acValue);
|
||||
}
|
||||
|
||||
void HXmlTableRow::add_cell_double( double dValue, int span_count)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%f", dValue);
|
||||
add_cell( acValue, span_count);
|
||||
}
|
||||
void HXmlTableRow::add_cell_int( int iValue, int span_count)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%d", iValue);
|
||||
add_cell( acValue, span_count);
|
||||
}
|
||||
|
||||
void HXmlTableRow::add_cell_double_formated( double dValue, int idecimal, int span_count)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), "%.*f", idecimal, dValue);
|
||||
add_cell( acValue, span_count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HXmlTableRow::add_rtf_cell( char* /*pcText*/, int span_count)
|
||||
{
|
||||
add_cell( "rtf", span_count);
|
||||
}
|
||||
|
||||
54
exchange/exchangesource/DumpFeatureTree/HXmlElement.h
Normal file
54
exchange/exchangesource/DumpFeatureTree/HXmlElement.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef __XMLELEMENT__
|
||||
#define __XMLELEMENT__
|
||||
|
||||
#ifndef WIN32
|
||||
#define sprintf_s(buf, buf_size, ...) sprintf((buf), __VA_ARGS__)
|
||||
#endif
|
||||
#include "tinyxml.h"
|
||||
class HXmlElement : public TiXmlElement
|
||||
{
|
||||
public:
|
||||
HXmlElement (const char * in_value):TiXmlElement(in_value){}
|
||||
virtual ~HXmlElement() {}
|
||||
HXmlElement* add_element( const char* pcText);
|
||||
//html
|
||||
HXmlElement* add_element_with_id( const char* pcText, const char* pcTextId);
|
||||
void add_value( const char* pcValue, bool bRTF = false);
|
||||
void add_value(double dValue, int idecimal);
|
||||
void add_value(int iValue);
|
||||
HXmlElement* add_header( const char* pcText);
|
||||
|
||||
HXmlElement* add_element_and_value( char* pcText, const char* pcValue, bool bRTF = false);
|
||||
HXmlElement* add_element_and_value( char* pcText, int iValue);
|
||||
HXmlElement* add_element_and_value( char* pcText, double dValue);
|
||||
HXmlElement* add_element_and_value( char* pcText, double dValue, int idecimal);
|
||||
};
|
||||
|
||||
class HXmlTableRow : public HXmlElement
|
||||
{
|
||||
public:
|
||||
HXmlTableRow ():HXmlElement("TR"){}
|
||||
~HXmlTableRow() {}
|
||||
|
||||
public:
|
||||
void add_cell( char* pcText, int span_count = 0);
|
||||
void add_cell( char* pcText, int row_span, int col_span);
|
||||
void add_cell_double( double dValue, int span_count = 0);
|
||||
void add_cell_double_formated( double dValue, int idecimal, int span_count);
|
||||
void add_cell_int( int iValue, int span_count = 0);
|
||||
void add_rtf_cell( char* pcText, int span_count = 0);
|
||||
};
|
||||
|
||||
|
||||
#endif //__XMLELEMENT__
|
||||
84
exchange/exchangesource/DumpFeatureTree/HXmlReport.cpp
Normal file
84
exchange/exchangesource/DumpFeatureTree/HXmlReport.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
#include "HXmlReport.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
HXmlReport::HXmlReport()
|
||||
{
|
||||
HXmlElement* psXmlElement = new HXmlElement("Root");
|
||||
m_apPath.push_back(psXmlElement);
|
||||
psXmlElement->SetAttribute("rel", "stylesheet");
|
||||
m_sDocument.LinkEndChild(psXmlElement);
|
||||
}
|
||||
HXmlReport::~HXmlReport()
|
||||
{
|
||||
}
|
||||
|
||||
void HXmlReport::SaveFile(const char* pcReportPath, const char* pcXslFile)
|
||||
{
|
||||
m_sDocument.SetCondenseWhiteSpace(false);
|
||||
|
||||
if (pcXslFile)
|
||||
{
|
||||
// stylesheet metadata are not supported by tinyXML
|
||||
// => we have to add xsl link manually at the beginning of the xml file
|
||||
|
||||
// Instead of directly write into file, plug a printer to XML document, to "write" xml in a std::string
|
||||
TiXmlPrinter printer;
|
||||
m_sDocument.Accept(&printer);
|
||||
|
||||
// Write xst information + printer string into file
|
||||
std::ofstream ofs;
|
||||
ofs.open(pcReportPath, std::ofstream::out);
|
||||
ofs << "<?xml version=\"1.0\"?>" << std::endl;
|
||||
ofs << "<?xml-stylesheet href=\"" << pcXslFile << "\" type=\"text/xsl\"?>" << std::endl;
|
||||
ofs << printer.CStr();
|
||||
ofs.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_sDocument.SaveFile(pcReportPath))
|
||||
fprintf(stdout, "XML file saved as %s\n", pcReportPath);
|
||||
else
|
||||
fprintf(stdout, "Cannot create XML file %s\n", pcReportPath);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void HXmlReport::closeSubNode()
|
||||
{
|
||||
if (m_apPath.empty())
|
||||
{
|
||||
//can remove root note
|
||||
return;
|
||||
}
|
||||
m_apPath.pop_back();
|
||||
}
|
||||
|
||||
void HXmlReport::addNode(HXmlElement* psNewNode)
|
||||
{
|
||||
if(psNewNode == NULL)
|
||||
return;
|
||||
if (m_apPath.empty())
|
||||
{
|
||||
//no tree create
|
||||
return;
|
||||
}
|
||||
|
||||
m_apPath.back()->LinkEndChild(psNewNode);
|
||||
}
|
||||
|
||||
void HXmlReport::createSubNode(const char* pcNameNode)
|
||||
{
|
||||
HXmlElement*psNewNode = new HXmlElement(pcNameNode);
|
||||
if (psNewNode == NULL)
|
||||
return;
|
||||
if (m_apPath.empty())
|
||||
{
|
||||
//no tree create
|
||||
return;
|
||||
}
|
||||
|
||||
m_apPath.back()->LinkEndChild(psNewNode);
|
||||
m_apPath.push_back(psNewNode);
|
||||
|
||||
}
|
||||
44
exchange/exchangesource/DumpFeatureTree/HXmlReport.h
Normal file
44
exchange/exchangesource/DumpFeatureTree/HXmlReport.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
#pragma once
|
||||
#ifndef __HECXMLREPORT_H__
|
||||
#define __HECXMLREPORT_H__
|
||||
|
||||
#include "HXmlElement.h"
|
||||
#include <vector>
|
||||
|
||||
class HXmlReport
|
||||
{
|
||||
TiXmlDocument m_sDocument;
|
||||
std::vector< HXmlElement*> m_apPath;
|
||||
|
||||
public:
|
||||
HXmlReport();
|
||||
~HXmlReport();
|
||||
|
||||
public:
|
||||
//==================================tree manipulation========================
|
||||
|
||||
inline HXmlElement* currentNode() const { return m_apPath.back(); }
|
||||
void closeSubNode();
|
||||
void addNode(HXmlElement* psNewNode);
|
||||
void createSubNode(const char* pcNameNode);
|
||||
void SaveFile(const char* pcReportPath, const char* pcXslFile = NULL);
|
||||
//==================================populate current node========================
|
||||
|
||||
public:
|
||||
inline void setAttribute(const char* name, const char * _value) { currentNode()->SetAttribute(name, _value); }
|
||||
inline void setAttribute(const char * name, int value) { currentNode()->SetAttribute(name, value); }
|
||||
inline void setAttribute(const char * name, double value) { currentNode()->SetDoubleAttribute(name, value); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
111
exchange/exchangesource/DumpFeatureTree/TinyXML/tinystr.cpp
Normal file
111
exchange/exchangesource/DumpFeatureTree/TinyXML/tinystr.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#include "tinystr.h"
|
||||
|
||||
// Error value for find primitive
|
||||
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
|
||||
|
||||
|
||||
// Null rep.
|
||||
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
|
||||
|
||||
|
||||
void TiXmlString::reserve (size_type cap)
|
||||
{
|
||||
if (cap > capacity())
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(length(), cap);
|
||||
memcpy(tmp.start(), data(), length());
|
||||
swap(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::assign(const char* str, size_type len)
|
||||
{
|
||||
size_type cap = capacity();
|
||||
if (len > cap || cap > 3*(len + 8))
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(len);
|
||||
memcpy(tmp.start(), str, len);
|
||||
swap(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove(start(), str, len);
|
||||
set_size(len);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::append(const char* str, size_type len)
|
||||
{
|
||||
size_type newsize = length() + len;
|
||||
if (newsize > capacity())
|
||||
{
|
||||
reserve (newsize + capacity());
|
||||
}
|
||||
memmove(finish(), str, len);
|
||||
set_size(newsize);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.reserve(a.length() + b.length());
|
||||
tmp += a;
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
|
||||
tmp.reserve(a.length() + b_len);
|
||||
tmp += a;
|
||||
tmp.append(b, b_len);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
|
||||
tmp.reserve(a_len + b.length());
|
||||
tmp.append(a, a_len);
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
#endif // TIXML_USE_STL
|
||||
305
exchange/exchangesource/DumpFeatureTree/TinyXML/tinystr.h
Normal file
305
exchange/exchangesource/DumpFeatureTree/TinyXML/tinystr.h
Normal file
@@ -0,0 +1,305 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#ifndef TIXML_STRING_INCLUDED
|
||||
#define TIXML_STRING_INCLUDED
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
/* The support for explicit isn't that universal, and it isn't really
|
||||
required - it is used to check that the TiXmlString class isn't incorrectly
|
||||
used. Be nice to old compilers and macro it here:
|
||||
*/
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
|
||||
// Microsoft visual studio, version 6 and higher.
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
|
||||
// GCC version 3 and higher.s
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#else
|
||||
#define TIXML_EXPLICIT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
TiXmlString is an emulation of a subset of the std::string template.
|
||||
Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
|
||||
Only the member functions relevant to the TinyXML project have been implemented.
|
||||
The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
|
||||
a string and there's no more room, we allocate a buffer twice as big as we need.
|
||||
*/
|
||||
class TiXmlString
|
||||
{
|
||||
public :
|
||||
// The size type used
|
||||
typedef size_t size_type;
|
||||
|
||||
// Error value for find primitive
|
||||
static const size_type npos; // = -1;
|
||||
|
||||
|
||||
// TiXmlString empty constructor
|
||||
TiXmlString () : rep_(&nullrep_)
|
||||
{
|
||||
}
|
||||
|
||||
// TiXmlString copy constructor
|
||||
TiXmlString ( const TiXmlString & copy) : rep_(0)
|
||||
{
|
||||
init(copy.length());
|
||||
memcpy(start(), copy.data(), length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
|
||||
{
|
||||
init( static_cast<size_type>( strlen(copy) ));
|
||||
memcpy(start(), copy, length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
|
||||
{
|
||||
init(len);
|
||||
memcpy(start(), str, len);
|
||||
}
|
||||
|
||||
// TiXmlString destructor
|
||||
~TiXmlString ()
|
||||
{
|
||||
quit();
|
||||
}
|
||||
|
||||
TiXmlString& operator = (const char * copy)
|
||||
{
|
||||
return assign( copy, (size_type)strlen(copy));
|
||||
}
|
||||
|
||||
TiXmlString& operator = (const TiXmlString & copy)
|
||||
{
|
||||
return assign(copy.start(), copy.length());
|
||||
}
|
||||
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const char * suffix)
|
||||
{
|
||||
return append(suffix, static_cast<size_type>( strlen(suffix) ));
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (char single)
|
||||
{
|
||||
return append(&single, 1);
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const TiXmlString & suffix)
|
||||
{
|
||||
return append(suffix.data(), suffix.length());
|
||||
}
|
||||
|
||||
|
||||
// Convert a TiXmlString into a null-terminated char *
|
||||
const char * c_str () const { return rep_->str; }
|
||||
|
||||
// Convert a TiXmlString into a char * (need not be null terminated).
|
||||
const char * data () const { return rep_->str; }
|
||||
|
||||
// Return the length of a TiXmlString
|
||||
size_type length () const { return rep_->size; }
|
||||
|
||||
// Alias for length()
|
||||
size_type size () const { return rep_->size; }
|
||||
|
||||
// Checks if a TiXmlString is empty
|
||||
bool empty () const { return rep_->size == 0; }
|
||||
|
||||
// Return capacity of string
|
||||
size_type capacity () const { return rep_->capacity; }
|
||||
|
||||
|
||||
// single char extraction
|
||||
const char& at (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// [] operator
|
||||
char& operator [] (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// find a char in a string. Return TiXmlString::npos if not found
|
||||
size_type find (char lookup) const
|
||||
{
|
||||
return find(lookup, 0);
|
||||
}
|
||||
|
||||
// find a char in a string from an offset. Return TiXmlString::npos if not found
|
||||
size_type find (char tofind, size_type offset) const
|
||||
{
|
||||
if (offset >= length()) return npos;
|
||||
|
||||
for (const char* p = c_str() + offset; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == tofind) return static_cast< size_type >( p - c_str() );
|
||||
}
|
||||
return npos;
|
||||
}
|
||||
|
||||
void clear ()
|
||||
{
|
||||
//Lee:
|
||||
//The original was just too strange, though correct:
|
||||
// TiXmlString().swap(*this);
|
||||
//Instead use the quit & re-init:
|
||||
quit();
|
||||
init(0,0);
|
||||
}
|
||||
|
||||
/* Function to reserve a big amount of data when we know we'll need it. Be aware that this
|
||||
function DOES NOT clear the content of the TiXmlString if any exists.
|
||||
*/
|
||||
void reserve (size_type cap);
|
||||
|
||||
TiXmlString& assign (const char* str, size_type len);
|
||||
|
||||
TiXmlString& append (const char* str, size_type len);
|
||||
|
||||
void swap (TiXmlString& other)
|
||||
{
|
||||
Rep* r = rep_;
|
||||
rep_ = other.rep_;
|
||||
other.rep_ = r;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void init(size_type sz) { init(sz, sz); }
|
||||
void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
|
||||
char* start() const { return rep_->str; }
|
||||
char* finish() const { return rep_->str + rep_->size; }
|
||||
|
||||
struct Rep
|
||||
{
|
||||
size_type size, capacity;
|
||||
char str[1];
|
||||
};
|
||||
|
||||
void init(size_type sz, size_type cap)
|
||||
{
|
||||
if (cap)
|
||||
{
|
||||
// Lee: the original form:
|
||||
// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
|
||||
// doesn't work in some cases of new being overloaded. Switching
|
||||
// to the normal allocation, although use an 'int' for systems
|
||||
// that are overly picky about structure alignment.
|
||||
const size_type bytesNeeded = sizeof(Rep) + cap;
|
||||
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
|
||||
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
|
||||
|
||||
rep_->str[ rep_->size = sz ] = '\0';
|
||||
rep_->capacity = cap;
|
||||
}
|
||||
else
|
||||
{
|
||||
rep_ = &nullrep_;
|
||||
}
|
||||
}
|
||||
|
||||
void quit()
|
||||
{
|
||||
if (rep_ != &nullrep_)
|
||||
{
|
||||
// The rep_ is really an array of ints. (see the allocator, above).
|
||||
// Cast it back before delete, so the compiler won't incorrectly call destructors.
|
||||
delete [] ( reinterpret_cast<int*>( rep_ ) );
|
||||
}
|
||||
}
|
||||
|
||||
Rep * rep_;
|
||||
static Rep nullrep_;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return ( a.length() == b.length() ) // optimization on some platforms
|
||||
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
|
||||
}
|
||||
inline bool operator < (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return strcmp(a.c_str(), b.c_str()) < 0;
|
||||
}
|
||||
|
||||
inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
|
||||
inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; }
|
||||
inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
|
||||
inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
|
||||
inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
|
||||
inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
|
||||
inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b);
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b);
|
||||
|
||||
|
||||
/*
|
||||
TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
|
||||
Only the operators that we need for TinyXML have been developped.
|
||||
*/
|
||||
class TiXmlOutStream : public TiXmlString
|
||||
{
|
||||
public :
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const TiXmlString & in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const char * in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif // TIXML_STRING_INCLUDED
|
||||
#endif // TIXML_USE_STL
|
||||
1886
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxml.cpp
Normal file
1886
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxml.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1805
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxml.h
Normal file
1805
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxml.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
// The goal of the seperate error file is to make the first
|
||||
// step towards localization. tinyxml (currently) only supports
|
||||
// english error messages, but the could now be translated.
|
||||
//
|
||||
// It also cleans up the code a bit.
|
||||
//
|
||||
|
||||
const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
|
||||
{
|
||||
"No error",
|
||||
"Error",
|
||||
"Failed to open file",
|
||||
"Error parsing Element.",
|
||||
"Failed to read Element name",
|
||||
"Error reading Element value.",
|
||||
"Error reading Attributes.",
|
||||
"Error: empty tag.",
|
||||
"Error reading end tag.",
|
||||
"Error parsing Unknown.",
|
||||
"Error parsing Comment.",
|
||||
"Error parsing Declaration.",
|
||||
"Error document empty.",
|
||||
"Error null (0) or unexpected EOF found in input stream.",
|
||||
"Error parsing CDATA.",
|
||||
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
|
||||
};
|
||||
1638
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxmlparser.cpp
Normal file
1638
exchange/exchangesource/DumpFeatureTree/TinyXML/tinyxmlparser.cpp
Normal file
File diff suppressed because it is too large
Load Diff
37
exchange/exchangesource/DumpFeatureTree/Visitor/Connector.h
Normal file
37
exchange/exchangesource/DumpFeatureTree/Visitor/Connector.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef A3D_CONNECTOR
|
||||
#define A3D_CONNECTOR
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef TF_A3DLIBS
|
||||
# define A3DAPI_INTERNAL
|
||||
#else
|
||||
#include <A3DSDKIncludes.h>
|
||||
#endif
|
||||
|
||||
class A3DConnector
|
||||
{
|
||||
protected:
|
||||
|
||||
const A3DEntity* m_pEntity;
|
||||
|
||||
A3DConnector(const A3DEntity* pEntity) : m_pEntity(pEntity) {}
|
||||
A3DConnector() : m_pEntity(NULL) {};
|
||||
public:
|
||||
|
||||
const A3DEntity* GetA3DEntity() const { return m_pEntity; }
|
||||
virtual A3DEEntityType GetType() const { return kA3DTypeUnknown; }
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
576
exchange/exchangesource/DumpFeatureTree/Visitor/TreeTraverse.cpp
Normal file
576
exchange/exchangesource/DumpFeatureTree/Visitor/TreeTraverse.cpp
Normal file
@@ -0,0 +1,576 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file TreeConnector.cpp
|
||||
|
||||
This file contains fuctionalities to traverse a Prc Model Tree
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#include "TreeTraverse.h"
|
||||
#include "VisitorContainer.h"
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Traverse Model File
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
// Traverse all the model tree
|
||||
A3DStatus A3DModelFileConnector::Traverse(A3DVisitorContainer* psVisitor, bool bVisitPrototype)
|
||||
{
|
||||
unsigned int uI;
|
||||
psVisitor->visitEnter(*this);
|
||||
|
||||
for (uI = 0; uI < m_sModelFileData.m_uiPOccurrencesSize; uI++)
|
||||
{
|
||||
psVisitor->SetCurrentPoFather(NULL);
|
||||
A3DProductOccurrenceConnector sTreeConnector(m_sModelFileData.m_ppPOccurrences[uI]);
|
||||
if (sTreeConnector.TraversePO(m_sModelFileData.m_ppPOccurrences[uI], psVisitor, bVisitPrototype) != A3D_SUCCESS)
|
||||
return A3D_ERROR;
|
||||
}
|
||||
psVisitor->visitLeave(*this);
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
// Traversing the assembly Structure
|
||||
A3DStatus A3DProductOccurrenceConnector::TraversePO(const A3DAsmProductOccurrence* pOccurrence,
|
||||
A3DVisitorContainer* psVisitor,
|
||||
bool bVisitPrototype)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
//Traverse AnnotationEntity
|
||||
A3DUns32 uI;
|
||||
#ifdef CONNECT_PMI
|
||||
A3DUns32 uNbAnnotationEntity = m_sProductOccurrenceData.m_uiAnnotationsSize;
|
||||
for (uI = 0; uI < uNbAnnotationEntity; uI++)
|
||||
{
|
||||
A3DMkpAnnotationEntityConnector sAnnotationEntityConnector(m_sProductOccurrenceData.m_ppAnnotations[uI]);
|
||||
sAnnotationEntityConnector.TraverseAnnotationEntity(psVisitor);
|
||||
}
|
||||
if (!uNbAnnotationEntity && m_sProductOccurrenceData.m_pPrototype != NULL)
|
||||
{
|
||||
A3DAsmProductOccurrence* pProductPrototype = m_sProductOccurrenceData.m_pPrototype;
|
||||
while (pProductPrototype)
|
||||
{
|
||||
A3DAsmProductOccurrenceData sProductPrototypeData;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sProductPrototypeData);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(pProductPrototype, &sProductPrototypeData));
|
||||
uNbAnnotationEntity = sProductPrototypeData.m_uiAnnotationsSize;
|
||||
for (uI = 0; uI < uNbAnnotationEntity; uI++)
|
||||
{
|
||||
A3DMkpAnnotationEntityConnector sAnnotationEntityConnector(sProductPrototypeData.m_ppAnnotations[uI]);
|
||||
sAnnotationEntityConnector.TraverseAnnotationEntity(psVisitor);
|
||||
}
|
||||
|
||||
pProductPrototype = sProductPrototypeData.m_pPrototype;
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(NULL, &sProductPrototypeData));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONNECT_VIEWS
|
||||
A3DUns32 uNbView = m_sProductOccurrenceData.m_uiViewsSize;
|
||||
if (!uNbView && m_sProductOccurrenceData.m_pPrototype != NULL)
|
||||
{
|
||||
A3DAsmProductOccurrence* pProductPrototype = m_sProductOccurrenceData.m_pPrototype;
|
||||
while (pProductPrototype)
|
||||
{
|
||||
A3DAsmProductOccurrenceData sProductPrototypeData;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sProductPrototypeData);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(pProductPrototype, &sProductPrototypeData));
|
||||
uNbView = sProductPrototypeData.m_uiViewsSize;
|
||||
for (uI = 0; uI < uNbView; uI++)
|
||||
{
|
||||
A3DMkpViewConnector sMkpViewConnector(sProductPrototypeData.m_ppViews[uI]);
|
||||
sMkpViewConnector.TraverseView(psVisitor);
|
||||
}
|
||||
pProductPrototype = sProductPrototypeData.m_pPrototype;
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(NULL, &sProductPrototypeData));
|
||||
}
|
||||
}
|
||||
else if (uNbView)
|
||||
{
|
||||
for (uI = 0; uI < uNbView; uI++)
|
||||
{
|
||||
A3DMkpViewConnector sMkpViewConnector(m_sProductOccurrenceData.m_ppViews[uI]);
|
||||
sMkpViewConnector.TraverseView(psVisitor);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONNECT_FEATURE
|
||||
|
||||
A3DUns32 uNbFeatureBasedEntity = m_sProductOccurrenceData.m_uiFeatureBasedEntitiesSize;
|
||||
if (!uNbFeatureBasedEntity && m_sProductOccurrenceData.m_pPrototype != NULL)
|
||||
{
|
||||
A3DAsmProductOccurrence* pProductPrototype = m_sProductOccurrenceData.m_pPrototype;
|
||||
while (pProductPrototype)
|
||||
{
|
||||
A3DAsmProductOccurrenceData sProductPrototypeData;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sProductPrototypeData);
|
||||
CHECK_RET(A3DAsmProductOccurrenceGet(pProductPrototype, &sProductPrototypeData));
|
||||
uNbFeatureBasedEntity = sProductPrototypeData.m_uiFeatureBasedEntitiesSize;
|
||||
for (uI = 0; uI < uNbFeatureBasedEntity; uI++)
|
||||
{
|
||||
A3DFRMTreeConnector sConnector(sProductPrototypeData.m_ppFeatureBasedEntities[uI]);
|
||||
sConnector.TraverseFeatureTree(psVisitor);
|
||||
}
|
||||
pProductPrototype = sProductPrototypeData.m_pPrototype;
|
||||
CHECK_RET(A3DAsmProductOccurrenceGet(NULL, &sProductPrototypeData));
|
||||
}
|
||||
}
|
||||
else if (uNbFeatureBasedEntity)
|
||||
{
|
||||
for (uI = 0; uI < uNbFeatureBasedEntity; uI++)
|
||||
{
|
||||
A3DFRMTreeConnector sConnector(m_sProductOccurrenceData.m_ppFeatureBasedEntities[uI]);
|
||||
sConnector.TraverseFeatureTree(psVisitor);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
A3DAsmPartDefinition* pPart = NULL;
|
||||
if (!bVisitPrototype)
|
||||
{
|
||||
CHECK_RET(GetPart(pPart));
|
||||
}
|
||||
else
|
||||
{
|
||||
pPart = m_sProductOccurrenceData.m_pPart;
|
||||
}
|
||||
if (pPart)
|
||||
{
|
||||
void * pEntityInMap = psVisitor->FindInMap(pPart);
|
||||
psVisitor->SetInMap(pPart, pPart);
|
||||
A3DPartConnector sPartConnector(pPart);
|
||||
psVisitor->SetCurrentPoFather(pOccurrence);
|
||||
sPartConnector.SetProductOccurenceFather(pOccurrence);
|
||||
|
||||
// if we haven't found the part in the map or if we traverse the instance
|
||||
if (pEntityInMap == NULL || psVisitor->TraverseInstances())
|
||||
{
|
||||
CHECK_RET(sPartConnector.TraversePart(psVisitor));
|
||||
}
|
||||
psVisitor->SetCurrentPoFather(NULL);
|
||||
}
|
||||
std::vector<A3DAsmProductOccurrence*> apSons;
|
||||
if (!bVisitPrototype)
|
||||
{
|
||||
CollectSons(apSons);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_sProductOccurrenceData.m_pPrototype)
|
||||
{
|
||||
if (psVisitor->FindInMap(m_sProductOccurrenceData.m_pPrototype) == NULL)
|
||||
{
|
||||
psVisitor->SetInMap(m_sProductOccurrenceData.m_pPrototype, m_sProductOccurrenceData.m_pPrototype);
|
||||
A3DProductOccurrenceConnector sPrototypeConnector(m_sProductOccurrenceData.m_pPrototype);
|
||||
sPrototypeConnector.SetPrototypeType(true);
|
||||
sPrototypeConnector.TraversePO(m_sProductOccurrenceData.m_pPrototype, psVisitor, bVisitPrototype);
|
||||
}
|
||||
}
|
||||
if (m_sProductOccurrenceData.m_pExternalData)
|
||||
{
|
||||
if (psVisitor->FindInMap(m_sProductOccurrenceData.m_pExternalData) == NULL)
|
||||
{
|
||||
psVisitor->SetInMap(m_sProductOccurrenceData.m_pExternalData, m_sProductOccurrenceData.m_pExternalData);
|
||||
A3DProductOccurrenceConnector sExternalConnector(m_sProductOccurrenceData.m_pExternalData);
|
||||
sExternalConnector.SetExternalType(true);
|
||||
sExternalConnector.TraversePO(m_sProductOccurrenceData.m_pExternalData, psVisitor, bVisitPrototype);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned int uSize = m_sProductOccurrenceData.m_uiPOccurrencesSize;
|
||||
for (uI = 0; uI < uSize; uI++)
|
||||
{
|
||||
apSons.push_back(m_sProductOccurrenceData.m_ppPOccurrences[uI]);
|
||||
}
|
||||
}
|
||||
|
||||
for (uI = 0; uI < apSons.size(); uI++)
|
||||
{
|
||||
A3DProductOccurrenceConnector sPoConnector(apSons[uI]);
|
||||
sPoConnector.SetProductOccurrenceFather(this->GetA3DEntity());
|
||||
psVisitor->SetCurrentPoFather(pOccurrence);
|
||||
CHECK_RET(sPoConnector.TraversePO(apSons[uI], psVisitor, bVisitPrototype));
|
||||
psVisitor->SetCurrentPoFather(NULL);
|
||||
}
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DProductOccurrenceConnector::CollectSons(
|
||||
std::vector<A3DAsmProductOccurrence*>& apSons) const
|
||||
{
|
||||
//Get Children or children on Prototype's ....Prototype's
|
||||
A3DAsmProductOccurrence* pPrototype = m_sProductOccurrenceData.m_pPrototype;
|
||||
A3DAsmProductOccurrence** ppPo = m_sProductOccurrenceData.m_ppPOccurrences;
|
||||
unsigned int uSize = m_sProductOccurrenceData.m_uiPOccurrencesSize;
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
while (uSize == 0 && pPrototype)
|
||||
{
|
||||
A3DAsmProductOccurrenceData sPrototypeData;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sPrototypeData);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(pPrototype, &sPrototypeData));
|
||||
pPrototype = sPrototypeData.m_pPrototype;
|
||||
|
||||
uSize = sPrototypeData.m_uiPOccurrencesSize;
|
||||
ppPo = sPrototypeData.m_ppPOccurrences;
|
||||
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(NULL, &sPrototypeData));
|
||||
}
|
||||
|
||||
unsigned uI;
|
||||
for (uI = 0; uI < uSize; uI++)
|
||||
apSons.push_back(ppPo[uI]);
|
||||
|
||||
//Get Children on Externals
|
||||
if (m_sProductOccurrenceData.m_pExternalData)
|
||||
{
|
||||
if (apSons.size() == 0)
|
||||
{
|
||||
A3DProductOccurrenceConnector sExternalConnector(m_sProductOccurrenceData.m_pExternalData);
|
||||
CHECK_RET(sExternalConnector.CollectSons(apSons));
|
||||
}
|
||||
else
|
||||
apSons.push_back(m_sProductOccurrenceData.m_pExternalData);
|
||||
}
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DProductOccurrenceConnector::GetPart(
|
||||
A3DAsmPartDefinition*& pPart) const
|
||||
{
|
||||
pPart = NULL;
|
||||
A3DStatus iRet = A3D_SUCCESS;;
|
||||
if (m_sProductOccurrenceData.m_pPart)
|
||||
{
|
||||
pPart = m_sProductOccurrenceData.m_pPart;
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DAsmProductOccurrence* pProductPrototype = m_sProductOccurrenceData.m_pPrototype;
|
||||
while (pProductPrototype)
|
||||
{
|
||||
A3DAsmProductOccurrenceData sProductPrototypeData;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sProductPrototypeData);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(pProductPrototype, &sProductPrototypeData));
|
||||
if (sProductPrototypeData.m_pPart)
|
||||
{
|
||||
pPart = sProductPrototypeData.m_pPart;
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(NULL, &sProductPrototypeData));
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
else
|
||||
pProductPrototype = sProductPrototypeData.m_pPrototype;
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DAsmProductOccurrenceGet,(NULL, &sProductPrototypeData));
|
||||
}
|
||||
|
||||
if (m_sProductOccurrenceData.m_uiPOccurrencesSize == 0)
|
||||
{
|
||||
if (m_sProductOccurrenceData.m_pExternalData)
|
||||
{
|
||||
A3DProductOccurrenceConnector sExternalconnector(m_sProductOccurrenceData.m_pExternalData);
|
||||
CHECK_RET(sExternalconnector.GetPart(pPart));
|
||||
}
|
||||
}
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DPartConnector::TraversePart(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
//Traverse AnnotationEntity
|
||||
A3DUns32 uI;
|
||||
#ifdef CONNECT_PMI
|
||||
A3DUns32 uNbAnnotationEntity = m_sPartData.m_uiAnnotationsSize;
|
||||
for (uI = 0; uI < uNbAnnotationEntity; uI++)
|
||||
{
|
||||
A3DMkpAnnotationEntityConnector sAnnotationEntityConnector(m_sPartData.m_ppAnnotations[uI]);
|
||||
sAnnotationEntityConnector.TraverseAnnotationEntity(psVisitor);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONNECT_VIEWS
|
||||
A3DUns32 uNbView = m_sPartData.m_uiViewsSize;
|
||||
for (uI = 0; uI < uNbView; uI++)
|
||||
{
|
||||
A3DMkpViewConnector sMkpViewConnector(m_sPartData.m_ppViews[uI]);
|
||||
sMkpViewConnector.TraverseView(psVisitor);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Traverse RI
|
||||
for (uI = 0; uI < m_sPartData.m_uiRepItemsSize; uI++)
|
||||
{
|
||||
A3DRiConnector sRiConnector(m_sPartData.m_ppRepItems[uI]);
|
||||
sRiConnector.TraverseRi(psVisitor);
|
||||
}
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DRiConnector::TraverseRi(A3DVisitorContainer* psVisitor)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
psVisitor->visitEnter(*this);
|
||||
|
||||
const A3DEntity* pRi = GetA3DEntity();
|
||||
A3DEEntityType eType = kA3DTypeUnknown;
|
||||
CALL_A3D_FCTION(A3DEntityGetType,(pRi,&eType));
|
||||
|
||||
if (iRet == A3D_SUCCESS)
|
||||
{
|
||||
switch (eType)
|
||||
{
|
||||
case kA3DTypeRiBrepModel:
|
||||
{
|
||||
A3DRiBrepModelConnector sConnector((A3DRiBrepModel*)pRi);
|
||||
CHECK_RET(sConnector.TraverseRiBrepModel(psVisitor));
|
||||
break;
|
||||
}
|
||||
case kA3DTypeRiSet:
|
||||
{
|
||||
A3DRiSetConnector sConnector(static_cast<A3DRiSet const *>(pRi));
|
||||
CHECK_RET(sConnector.TraverseRiSet(psVisitor));
|
||||
break;
|
||||
}
|
||||
|
||||
case kA3DTypeRiCurve:
|
||||
{
|
||||
A3DRiCurveConnector sConnector((A3DRiCurve*)pRi);
|
||||
CHECK_RET(sConnector.TraverseRiCurve(psVisitor));
|
||||
break;
|
||||
}
|
||||
case kA3DTypeRiPointSet:
|
||||
case kA3DTypeRiDirection:
|
||||
case kA3DTypeRiCoordinateSystem:
|
||||
case kA3DTypeRiPlane:
|
||||
break;
|
||||
case kA3DTypeRiPolyBrepModel:
|
||||
{
|
||||
A3DPolyRiBrepModelConnector sConnector((A3DRiPolyBrepModel*)pRi);
|
||||
CHECK_RET(sConnector.TraverseRiPolyBrepModel(psVisitor));
|
||||
break;
|
||||
}
|
||||
case kA3DTypeRiPolyWire:
|
||||
{
|
||||
A3DRiPolyWireConnector sConnector((A3DRiPolyWire*)pRi);
|
||||
CHECK_RET(sConnector.TraverseRiPolyWire(psVisitor));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
iRet = A3D_NOT_IMPLEMENTED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
psVisitor->visitLeave(*this);
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
// RiBrepModel
|
||||
A3DStatus A3DRiBrepModelConnector::TraverseRiBrepModel(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
//Traverse Mesh
|
||||
#ifdef CONNECT_MESH
|
||||
A3DRiRepresentationItemData sRidata;
|
||||
A3D_INITIALIZE_DATA(A3DRiRepresentationItemData, sRidata);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DRiRepresentationItemGet,(this->GetA3DEntity(), &sRidata));
|
||||
A3DTessDataConnector sTessConnector((A3DTess3D*)sRidata.m_pTessBase);
|
||||
CHECK_RET(sTessConnector.Traverse(psVisitor));
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DRiRepresentationItemGet,(NULL, &sRidata));
|
||||
#endif
|
||||
|
||||
//Traverse Brep Data
|
||||
#ifdef CONNECT_BREP
|
||||
A3DBrepDataConnector sTopoConnector(m_sRiBrepModelData.m_pBrepData);
|
||||
CHECK_RET(sTopoConnector.Traverse(psVisitor));
|
||||
|
||||
#endif
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
// RiSet
|
||||
A3DStatus A3DRiSetConnector::TraverseRiSet(A3DVisitorContainer* psVisitor)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
unsigned uI;
|
||||
for (uI = 0; uI < m_sRiSetData.m_uiRepItemsSize; uI++)
|
||||
{
|
||||
A3DRiConnector sRiConnector(m_sRiSetData.m_ppRepItems[uI]);
|
||||
sRiConnector.TraverseRi(psVisitor);
|
||||
}
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
// RiPolyBrepModel
|
||||
A3DStatus A3DPolyRiBrepModelConnector::TraverseRiPolyBrepModel(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
/*
|
||||
A3DRiRepresentationItemData sRiData;
|
||||
A3D_INITIALIZE_DATA(A3DRiRepresentationItemData, sRiData);
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DRiRepresentationItemGet,(this->GetA3DEntity(), &sRiData));
|
||||
A3DTessDataConnector sTessConnector((A3DTess3D*)sRiData.m_pTessBase);
|
||||
CHECK_RET(sTessConnector.Traverse(psVisitor));
|
||||
CHECK_RET_CALL_A3D_FCTION(A3DRiRepresentationItemGet,(NULL, &sRiData));
|
||||
*/
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
// RiCurve
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
A3DStatus A3DRiCurveConnector::TraverseRiCurve(A3DVisitorContainer* psVisitor)
|
||||
{
|
||||
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
#ifdef CONNECT_MESH
|
||||
A3DRiRepresentationItemData sRidata;
|
||||
A3D_INITIALIZE_DATA(A3DRiRepresentationItemData, sRidata);
|
||||
CHECK_RET(A3DRiRepresentationItemGet(this->GetA3DEntity(), &sRidata));
|
||||
A3DWireTessDataConnector sWireTessConnector((A3DTess3DWire*)sRidata.m_pTessBase);
|
||||
CHECK_RET(sWireTessConnector.Traverse(psVisitor));
|
||||
CHECK_RET(A3DRiRepresentationItemGet(NULL, &sRidata));
|
||||
#endif
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
// RiPolyWire
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
A3DStatus A3DRiPolyWireConnector::TraverseRiPolyWire(A3DVisitorContainer* psVisitor)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
#ifdef CONNECT_MESH
|
||||
A3DRiRepresentationItemData sRidata;
|
||||
A3D_INITIALIZE_DATA(A3DRiRepresentationItemData, sRidata);
|
||||
CHECK_RET(A3DRiRepresentationItemGet(this->GetA3DEntity(), &sRidata));
|
||||
A3DWireTessDataConnector sWireTessConnector((A3DTess3DWire*)sRidata.m_pTessBase);
|
||||
CHECK_RET(sWireTessConnector.Traverse(psVisitor));
|
||||
CHECK_RET(A3DRiRepresentationItemGet(NULL, &sRidata));
|
||||
#endif
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
// A3DFRMParameter
|
||||
A3DStatus A3DFRMFeatureConnector::TraverseFeature(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
unsigned uI;
|
||||
|
||||
for (uI = 0; uI < m_sData.m_uiConnectionSize; uI++)
|
||||
{
|
||||
A3DFRMLinkedItemConnector sFeatureLinkedItemConnector(m_sData.m_ppConnections[uI]);
|
||||
sFeatureLinkedItemConnector.TraverseConnection(psVisitor);
|
||||
}
|
||||
|
||||
|
||||
for (uI = 0; uI < m_sData.m_uiParametersSize; uI++)
|
||||
{
|
||||
A3DFRMParameterConnector sParameterConnector(m_sData.m_ppParameters[uI]);
|
||||
sParameterConnector.TraverseParameter(psVisitor);
|
||||
}
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
// A3DFRMParameter
|
||||
A3DStatus A3DFRMLinkedItemConnector::TraverseConnection(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
return iRet;
|
||||
}
|
||||
|
||||
// A3DFRMParameter
|
||||
A3DStatus A3DFRMParameterConnector::TraverseParameter(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
unsigned uI;
|
||||
|
||||
for (uI = 0; uI < m_sData.m_uiFeatureSize; uI++)
|
||||
{
|
||||
A3DFRMFeatureConnector sFeatureConnector(m_sData.m_ppFeatures[uI]);
|
||||
sFeatureConnector.TraverseFeature(psVisitor);
|
||||
}
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
// FeatureTree
|
||||
A3DStatus A3DFRMTreeConnector::TraverseFeatureTree(A3DVisitorContainer* psVisitor) const
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
CHECK_RET(psVisitor->visitEnter(*this));
|
||||
unsigned uI;
|
||||
|
||||
for (uI = 0; uI < m_sTreeData.m_uiIntermediateGeometriesSize; uI++)
|
||||
{
|
||||
A3DRiConnector sRiConnector(m_sTreeData.m_ppIntermediateGeometries[uI]);
|
||||
sRiConnector.TraverseRi(psVisitor);
|
||||
}
|
||||
|
||||
for (uI = 0; uI < m_sTreeData.m_uiParametersSize; uI++)
|
||||
{
|
||||
A3DFRMParameterConnector sParameterConnector(m_sTreeData.m_ppsParameters[uI]);
|
||||
sParameterConnector.TraverseParameter(psVisitor);
|
||||
}
|
||||
|
||||
CHECK_RET(psVisitor->visitLeave(*this));
|
||||
|
||||
return iRet;
|
||||
}
|
||||
364
exchange/exchangesource/DumpFeatureTree/Visitor/TreeTraverse.h
Normal file
364
exchange/exchangesource/DumpFeatureTree/Visitor/TreeTraverse.h
Normal file
@@ -0,0 +1,364 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef A3D_TREE_CONNECTOR
|
||||
#define A3D_TREE_CONNECTOR
|
||||
|
||||
#include <vector>
|
||||
#include "Connector.h"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
class A3DVisitorContainer;
|
||||
class A3DModelFileConnector : public A3DConnector
|
||||
{
|
||||
public:
|
||||
|
||||
A3DModelFileConnector(const A3DAsmModelFile* pModelFile) : A3DConnector(pModelFile)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DAsmModelFileData, m_sModelFileData);
|
||||
A3DAsmModelFileGet(pModelFile, &m_sModelFileData);
|
||||
}
|
||||
|
||||
~A3DModelFileConnector() { A3DAsmModelFileGet(NULL, &m_sModelFileData); }
|
||||
|
||||
A3DStatus Traverse(A3DVisitorContainer* psVisitor, bool bVisitPrototype = false);
|
||||
|
||||
public:
|
||||
|
||||
A3DAsmModelFileData m_sModelFileData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DProductOccurrenceConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DModelFileConnector;
|
||||
const A3DAsmProductOccurrence* m_pFather;
|
||||
bool m_bIsInstanciated;
|
||||
bool m_bIsPrototype;
|
||||
bool m_bIsExternal;
|
||||
|
||||
private:
|
||||
|
||||
A3DProductOccurrenceConnector(const A3DAsmProductOccurrence* pProductOccurrence)
|
||||
: A3DConnector(pProductOccurrence)
|
||||
{
|
||||
m_pFather = NULL;
|
||||
m_bIsInstanciated = false;
|
||||
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, m_sProductOccurrenceData);
|
||||
A3DAsmProductOccurrenceGet(pProductOccurrence, &m_sProductOccurrenceData);
|
||||
m_bIsPrototype = false;
|
||||
m_bIsExternal = false;
|
||||
}
|
||||
|
||||
~A3DProductOccurrenceConnector() { A3DAsmProductOccurrenceGet(NULL, &m_sProductOccurrenceData); }
|
||||
|
||||
A3DStatus TraversePO(const A3DAsmProductOccurrence* pOccurrence, A3DVisitorContainer* psVisitor, bool bVisitPrototype = false);
|
||||
|
||||
void SetProductOccurrenceFather(const A3DAsmProductOccurrence* pFather) { m_pFather = pFather; }
|
||||
|
||||
public:
|
||||
A3DStatus GetPart(A3DAsmPartDefinition*& pPart) const;
|
||||
A3DStatus CollectSons(std::vector<A3DAsmProductOccurrence*>& apSons) const;
|
||||
|
||||
A3DAsmProductOccurrenceData m_sProductOccurrenceData;
|
||||
const A3DAsmProductOccurrence* GetProductOccurrenceFather() { return m_pFather; }
|
||||
void SetIsInstanciated(bool bIsInstanciated) { m_bIsInstanciated = bIsInstanciated; }
|
||||
bool IsInstanciated() { return m_bIsInstanciated; }
|
||||
void SetPrototypeType(bool bIsPrototype) { m_bIsPrototype = bIsPrototype; }
|
||||
bool IsProtoType() const { return m_bIsPrototype; }
|
||||
void SetExternalType(bool bIsExternal) { m_bIsExternal = bIsExternal; }
|
||||
bool IsExternal() const { return m_bIsExternal; }
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DPartConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DProductOccurrenceConnector;
|
||||
const A3DAsmProductOccurrence* m_pFather;
|
||||
bool m_bIsInstanciated;
|
||||
|
||||
private:
|
||||
|
||||
A3DPartConnector(const A3DAsmPartDefinition *pPart) : A3DConnector(pPart)
|
||||
{
|
||||
m_pFather = NULL;
|
||||
m_bIsInstanciated = false;
|
||||
A3D_INITIALIZE_DATA(A3DAsmPartDefinitionData, m_sPartData);
|
||||
A3DAsmPartDefinitionGet(pPart, &m_sPartData);
|
||||
}
|
||||
|
||||
~A3DPartConnector()
|
||||
{
|
||||
A3DAsmPartDefinitionGet(NULL, &m_sPartData);
|
||||
}
|
||||
|
||||
void SetProductOccurenceFather(const A3DAsmProductOccurrence* pFather) { m_pFather = pFather; }
|
||||
|
||||
public:
|
||||
A3DStatus TraversePart(A3DVisitorContainer* psVisitor) const;
|
||||
A3DAsmPartDefinitionData m_sPartData;
|
||||
const A3DAsmProductOccurrence* GetProductOccurenceFather() { return m_pFather; }
|
||||
void SetIsInstanciated(bool bIsInstanciated) { m_bIsInstanciated = bIsInstanciated; }
|
||||
bool IsInstanciated() { return m_bIsInstanciated; }
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DRiConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DPartConnector;
|
||||
friend class A3DRiSetConnector;
|
||||
bool m_bIsInstanciated;
|
||||
|
||||
public:
|
||||
|
||||
A3DRiConnector(const A3DRiRepresentationItem *pRi) : A3DConnector(pRi)
|
||||
{
|
||||
m_bIsInstanciated = false;
|
||||
A3D_INITIALIZE_DATA(A3DRiRepresentationItemData, m_sRiData);
|
||||
A3DRiRepresentationItemGet(pRi, &m_sRiData);
|
||||
}
|
||||
|
||||
~A3DRiConnector()
|
||||
{
|
||||
A3DRiRepresentationItemGet(NULL, &m_sRiData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseRi(A3DVisitorContainer* psVisitor);
|
||||
|
||||
public:
|
||||
|
||||
A3DRiRepresentationItemData m_sRiData;
|
||||
void SetIsInstanciated(bool bIsInstanciated) { m_bIsInstanciated = bIsInstanciated; }
|
||||
bool IsInstanciated() { return m_bIsInstanciated; }
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DRiBrepModelConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DRiConnector;
|
||||
public:
|
||||
|
||||
A3DRiBrepModelConnector(const A3DRiBrepModel *pRi) : m_pRiBrepModel(pRi), A3DConnector(pRi)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DRiBrepModelData, m_sRiBrepModelData);
|
||||
A3DRiBrepModelGet(m_pRiBrepModel, &m_sRiBrepModelData);
|
||||
}
|
||||
|
||||
~A3DRiBrepModelConnector()
|
||||
{
|
||||
A3DRiBrepModelGet(NULL, &m_sRiBrepModelData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseRiBrepModel(A3DVisitorContainer* psVisitor) const;
|
||||
|
||||
public:
|
||||
A3DRiBrepModel const* m_pRiBrepModel;
|
||||
A3DRiBrepModelData m_sRiBrepModelData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DRiSetConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DRiConnector;
|
||||
private:
|
||||
|
||||
A3DRiSetConnector(const A3DRiSet *pRi) : A3DConnector(pRi)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DRiSetData, m_sRiSetData);
|
||||
A3DRiSetGet(pRi, &m_sRiSetData);
|
||||
}
|
||||
|
||||
~A3DRiSetConnector()
|
||||
{
|
||||
A3DRiSetGet(NULL, &m_sRiSetData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseRiSet(A3DVisitorContainer* psVisitor);
|
||||
|
||||
public:
|
||||
|
||||
A3DRiSetData m_sRiSetData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DPolyRiBrepModelConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DRiConnector;
|
||||
private:
|
||||
|
||||
A3DPolyRiBrepModelConnector(const A3DRiPolyBrepModel* pRi) : A3DConnector(pRi)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DRiPolyBrepModelData, m_sRiPolyBrepModelData);
|
||||
A3DRiPolyBrepModelGet(pRi, &m_sRiPolyBrepModelData);
|
||||
}
|
||||
|
||||
~A3DPolyRiBrepModelConnector()
|
||||
{
|
||||
A3DRiPolyBrepModelGet(NULL, &m_sRiPolyBrepModelData);
|
||||
}
|
||||
|
||||
public:
|
||||
A3DStatus TraverseRiPolyBrepModel(A3DVisitorContainer* psVisitor) const;
|
||||
A3DRiPolyBrepModelData m_sRiPolyBrepModelData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DRiCurveConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DRiConnector;
|
||||
private:
|
||||
|
||||
A3DRiCurveConnector(const A3DRiCurve* pRi) : A3DConnector(pRi)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DRiCurveData, m_sRiCurveData);
|
||||
A3DRiCurveGet(pRi, &m_sRiCurveData);
|
||||
}
|
||||
|
||||
~A3DRiCurveConnector()
|
||||
{
|
||||
A3DRiCurveGet(NULL, &m_sRiCurveData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseRiCurve(A3DVisitorContainer* psVisitor);
|
||||
|
||||
public:
|
||||
|
||||
A3DRiCurveData m_sRiCurveData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DRiPolyWireConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DRiConnector;
|
||||
private:
|
||||
|
||||
A3DRiPolyWireConnector(const A3DRiPolyWire* pRi) : A3DConnector(pRi)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DRiPolyWireData, m_sRiPolyWireData);
|
||||
A3DRiPolyWireGet(pRi, &m_sRiPolyWireData);
|
||||
}
|
||||
|
||||
~A3DRiPolyWireConnector()
|
||||
{
|
||||
A3DRiPolyWireGet(NULL, &m_sRiPolyWireData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseRiPolyWire(A3DVisitorContainer* psVisitor);
|
||||
|
||||
public:
|
||||
|
||||
A3DRiPolyWireData m_sRiPolyWireData;
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DFRMParameterConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DFRMTreeConnector;
|
||||
friend class A3DFRMFeatureConnector;
|
||||
private:
|
||||
|
||||
A3DFRMParameterConnector(const A3DFRMParameter *pParameter) : A3DConnector(pParameter)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DFRMParameterData, m_sData);
|
||||
A3DFRMParameterGet(pParameter, &m_sData);
|
||||
}
|
||||
|
||||
~A3DFRMParameterConnector()
|
||||
{
|
||||
A3DFRMParameterGet(NULL, &m_sData);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
A3DFRMParameterData m_sData;
|
||||
|
||||
A3DStatus TraverseParameter(A3DVisitorContainer* psVisitor) const;
|
||||
};
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DFRMLinkedItemConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DFRMFeatureConnector;
|
||||
private:
|
||||
|
||||
A3DFRMLinkedItemConnector(const A3DFRMLinkedItem *pLinkedItem) : A3DConnector(pLinkedItem)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DFRMLinkedItemData, m_sData);
|
||||
A3DFRMLinkedItemGet(pLinkedItem, &m_sData);
|
||||
}
|
||||
|
||||
~A3DFRMLinkedItemConnector()
|
||||
{
|
||||
A3DFRMLinkedItemGet(NULL, &m_sData);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
A3DFRMLinkedItemData m_sData;
|
||||
|
||||
A3DStatus TraverseConnection(A3DVisitorContainer* psVisitor) const;
|
||||
};
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DFRMFeatureConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DFRMParameterConnector;
|
||||
private:
|
||||
|
||||
A3DFRMFeatureConnector(const A3DFRMFeature *pFeature) : A3DConnector(pFeature)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DFRMFeatureData, m_sData);
|
||||
A3DFRMFeatureGet(pFeature, &m_sData);
|
||||
}
|
||||
|
||||
~A3DFRMFeatureConnector()
|
||||
{
|
||||
A3DFRMFeatureGet(NULL, &m_sData);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
A3DFRMFeatureData m_sData;
|
||||
A3DStatus TraverseFeature(A3DVisitorContainer* psVisitor) const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
//######################################################################################################################
|
||||
class A3DFRMTreeConnector : public A3DConnector
|
||||
{
|
||||
friend class A3DProductOccurrenceConnector;
|
||||
protected:
|
||||
|
||||
A3DFRMTreeConnector(const A3DFRMTree *pTree) : A3DConnector(pTree)
|
||||
{
|
||||
A3D_INITIALIZE_DATA(A3DFRMTreeData, m_sTreeData);
|
||||
A3DFRMTreeGet(pTree, &m_sTreeData);
|
||||
}
|
||||
|
||||
~A3DFRMTreeConnector()
|
||||
{
|
||||
A3DFRMTreeGet(NULL, &m_sTreeData);
|
||||
}
|
||||
|
||||
A3DStatus TraverseFeatureTree(A3DVisitorContainer* psVisitor) const;
|
||||
|
||||
public:
|
||||
|
||||
A3DFRMTreeData m_sTreeData;
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,586 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#include "VisitorContainer.h"
|
||||
#include "Visitors.h"
|
||||
|
||||
|
||||
#ifdef CONNECT_ASSEMBLY_TREE
|
||||
#include "VisitorTree.h"
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define VISITENTER \
|
||||
{\
|
||||
ActivateEntityReference(sConnector.GetA3DEntity()); \
|
||||
for(unsigned uI = 0; uI < m_apVisitor.size(); uI++)\
|
||||
m_apVisitor[uI]->visitEnter(sConnector);\
|
||||
return A3D_SUCCESS;\
|
||||
}
|
||||
|
||||
#define VISITLEAVE \
|
||||
{\
|
||||
DeactivateEntityReference(sConnector.GetA3DEntity()); \
|
||||
for(unsigned uI = 0; uI < m_apVisitor.size(); uI++)\
|
||||
m_apVisitor[uI]->visitLeave(sConnector);\
|
||||
return A3D_SUCCESS;\
|
||||
}
|
||||
|
||||
//Tree
|
||||
#ifdef CONNECT_ASSEMBLY_TREE
|
||||
//
|
||||
// static A3DStatus stCreateAndPushCascadedAttributes( const A3DRootBaseWithGraphics* pBase,
|
||||
// const A3DMiscCascadedAttributes* pFatherAttr,
|
||||
// A3DMiscCascadedAttributes** ppAttr,
|
||||
// A3DMiscCascadedAttributesData* psAttrData)
|
||||
// {
|
||||
// A3DStatus iRet = A3D_SUCCESS;
|
||||
//
|
||||
// CHECK_RET(A3DMiscCascadedAttributesCreate(ppAttr));
|
||||
// CHECK_RET(A3DMiscCascadedAttributesPush(*ppAttr, pBase, pFatherAttr));
|
||||
//
|
||||
// A3D_INITIALIZE_DATA(A3DMiscCascadedAttributesData, (*psAttrData));
|
||||
// CHECK_RET(A3DMiscCascadedAttributesGet(*ppAttr, psAttrData));
|
||||
//
|
||||
// return iRet;
|
||||
// }
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DModelFileConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DProductOccurrenceConnector& sConnector)
|
||||
{
|
||||
m_uiCurrentLevel++;
|
||||
|
||||
// Entity Reference
|
||||
unsigned int uI, uNbRefEntity = sConnector.m_sProductOccurrenceData.m_uiEntityReferenceSize;
|
||||
for(uI = 0; uI < uNbRefEntity; uI++)
|
||||
{
|
||||
A3DMiscEntityReferenceData sMiscRefData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscEntityReferenceData, sMiscRefData);
|
||||
A3DMiscEntityReference* pEntityRef = sConnector.m_sProductOccurrenceData.m_ppEntityReferences[uI];
|
||||
A3DMiscEntityReferenceGet(pEntityRef, &sMiscRefData);
|
||||
A3DStepEntityRefManager sEntityManager;
|
||||
sEntityManager.m_pStepEntityRef = pEntityRef;
|
||||
sEntityManager.m_uiPOLevel = m_uiCurrentLevel;
|
||||
|
||||
A3DEEntityType sType;
|
||||
A3DEntityGetType(sMiscRefData.m_pEntity, &sType);
|
||||
if(sType == kA3DTypeMiscReferenceOnTopology)
|
||||
{
|
||||
A3DMiscReferenceOnTopologyData sTopoRefData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTopologyData,sTopoRefData);
|
||||
A3DMiscReferenceOnTopologyGet(pEntityRef, &sTopoRefData);
|
||||
sEntityManager.m_pA3DEntityRef = sTopoRefData.m_pBrepData;
|
||||
sEntityManager.m_bRefOnTopoItem = true;
|
||||
A3DMiscReferenceOnTopologyGet(NULL, &sTopoRefData);
|
||||
}
|
||||
else if(sType == kA3DTypeMiscReferenceOnCsysItem)
|
||||
{
|
||||
A3DMiscReferenceOnCsysItemData sA3DMiscReferenceOnCSYSITemData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnCsysItemData, sA3DMiscReferenceOnCSYSITemData);
|
||||
A3DMiscReferenceOnCsysItemGet(pEntityRef, &sA3DMiscReferenceOnCSYSITemData);
|
||||
sEntityManager.m_pA3DEntityRef = sA3DMiscReferenceOnCSYSITemData.m_pCoordinateSystem;
|
||||
A3DMiscReferenceOnCsysItemGet(NULL, &sA3DMiscReferenceOnCSYSITemData);
|
||||
}
|
||||
else
|
||||
sEntityManager.m_pA3DEntityRef = sMiscRefData.m_pEntity;
|
||||
|
||||
A3DMiscEntityReferenceGet(NULL, &sMiscRefData);
|
||||
|
||||
m_asStepEntityRefManager.push_back(sEntityManager);
|
||||
}
|
||||
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
|
||||
ActivateEntityReference(sConnector.GetA3DEntity());
|
||||
for(uI = 0; uI < m_apVisitor.size(); uI++)
|
||||
{
|
||||
m_apVisitor[uI]->visitEnter(sConnector);
|
||||
}
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DPartConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DRiConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DRiBrepModelConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DRiSetConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DPolyRiBrepModelConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DModelFileConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DProductOccurrenceConnector& sConnector)
|
||||
{
|
||||
for(unsigned uI = 0; uI < m_apVisitor.size(); uI++)
|
||||
{
|
||||
m_apVisitor[uI]->visitLeave(sConnector);
|
||||
}
|
||||
|
||||
unsigned int uI, uNbRefEntity = sConnector.m_sProductOccurrenceData.m_uiEntityReferenceSize;
|
||||
for (uI = 0; uI < uNbRefEntity; uI++)
|
||||
{
|
||||
m_asStepEntityRefManager.pop_back();
|
||||
}
|
||||
|
||||
|
||||
DeactivateEntityReference(sConnector.GetA3DEntity());
|
||||
|
||||
m_uiCurrentLevel--;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DPartConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DRiConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DRiBrepModelConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DRiSetConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DPolyRiBrepModelConnector& sConnector)
|
||||
VISITLEAVE
|
||||
#endif
|
||||
|
||||
//Markup
|
||||
#ifdef CONNECT_PMI
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMkpAnnotationEntityConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMkpAnnotationSetConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMkpAnnotationItemConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMarkupConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMarkupDimensionConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMarkupGDTConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMarkupDatumConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMarkupTessConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMkpAnnotationEntityConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMkpAnnotationSetConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMkpAnnotationItemConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMarkupDimensionConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMarkupConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMarkupGDTConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMarkupDatumConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMarkupTessConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
#endif
|
||||
|
||||
//Brep
|
||||
#ifdef CONNECT_BREP
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DBrepDataConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DConnexConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DShellConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFaceConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DLoopConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DCoEdgeConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DEdgeConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DUniqueVertexConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMultipleVertexConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DBrepDataConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DConnexConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DShellConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFaceConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DLoopConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DCoEdgeConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DEdgeConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DUniqueVertexConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMultipleVertexConnector& sConnector)
|
||||
VISITLEAVE
|
||||
#endif
|
||||
|
||||
//Mesh
|
||||
#ifdef CONNECT_MESH
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DTessDataConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DTessDataConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFaceTessDataConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFaceTessDataConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DWireTessDataConnector& sConnector)
|
||||
VISITENTER
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DWireTessDataConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
//VISIT(const A3DTessDataConnector&)
|
||||
#endif
|
||||
|
||||
A3DVisitorContainer::A3DVisitorContainer(unsigned int uFlagElementToconnect)
|
||||
: A3DVisitor("Container"),
|
||||
m_pTreeVisitor(NULL),
|
||||
m_pCurrentPOFather(NULL),
|
||||
m_psActivatedView(NULL),
|
||||
m_bTraverseActivatedViewOnly(true),
|
||||
m_uiCurrentLevel(0)
|
||||
{
|
||||
#ifdef CONNECT_TRANSFO
|
||||
if(uFlagElementToconnect&CONNECT_TRANSFO)
|
||||
{
|
||||
A3DVisitorTransfo* psVisistorTransfo = new A3DVisitorTransfo(this);
|
||||
this->push( psVisistorTransfo);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_COLORS
|
||||
if(uFlagElementToconnect&CONNECT_COLORS)
|
||||
{
|
||||
A3DVisitorColorMaterials* psVisitorcascadedAttribute = new A3DVisitorColorMaterials(this);
|
||||
this->push( psVisitorcascadedAttribute);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_MESH
|
||||
if(uFlagElementToconnect&CONNECT_MESH)
|
||||
{
|
||||
A3DVisitorTessellation* psVisitorTessellation = new A3DVisitorTessellation(this);
|
||||
this->push( psVisitorTessellation);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_BREP
|
||||
if(uFlagElementToconnect&CONNECT_BREP)
|
||||
{
|
||||
A3DVisitorBrep* psVisitorBrep = new A3DVisitorBrep(this);
|
||||
this->push( psVisitorBrep);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_ASSEMBLY_TREE
|
||||
if(uFlagElementToconnect&CONNECT_ASSEMBLY_TREE)
|
||||
{
|
||||
A3DTreeVisitor* psVisitorTree= new A3DTreeVisitor(this);
|
||||
this->push( psVisitorTree);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_PMI
|
||||
if(uFlagElementToconnect&CONNECT_PMI)
|
||||
{
|
||||
//A3DVisitorPMI* psVisitorPMI = new A3DVisitorPMI(this);
|
||||
//this->push( psVisitorPMI );
|
||||
}
|
||||
#endif
|
||||
#ifdef CONNECT_VIEWS
|
||||
if(uFlagElementToconnect&CONNECT_VIEWS)
|
||||
{
|
||||
// Not yet Implemented
|
||||
// A3DVisitorview* psVisitorViews = new A3DVisitorview(this);
|
||||
// this->push( psVisitorViews);
|
||||
}
|
||||
m_bTraverseInstance = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONNECT_VIEWS
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DMkpViewConnector& sConnector)
|
||||
{
|
||||
if ((m_psActivatedView == NULL) || (m_psActivatedView != sConnector.GetA3DEntity()))
|
||||
{
|
||||
if (!m_bTraverseActivatedViewOnly)
|
||||
{
|
||||
VISITENTER;
|
||||
}
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
// VISITENTER
|
||||
ActivateEntityReference(sConnector.GetA3DEntity());
|
||||
for (unsigned uI = 0; uI < m_apVisitor.size(); uI++)
|
||||
{
|
||||
m_apVisitor[uI]->visitEnter(sConnector);
|
||||
}
|
||||
|
||||
unsigned int uI, uNbRefEntity = sConnector.GetViewData().m_uiLinkedItemsSize;
|
||||
for (uI = 0; uI < uNbRefEntity; uI++)
|
||||
{
|
||||
A3DMiscMarkupLinkedItemData sMkpLinkedItemData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscMarkupLinkedItemData, sMkpLinkedItemData);
|
||||
A3DMiscMarkupLinkedItem* pMkpLinkedItemEntityRef = sConnector.GetViewData().m_ppLinkedItems[uI];
|
||||
A3DMiscMarkupLinkedItemGet(pMkpLinkedItemEntityRef, &sMkpLinkedItemData);
|
||||
A3DViewLinkedItemManager sViewLinkedItemManager;
|
||||
|
||||
A3DMiscEntityReferenceData sMiscRefData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscEntityReferenceData, sMiscRefData);
|
||||
A3DMiscEntityReferenceGet(pMkpLinkedItemEntityRef, &sMiscRefData);
|
||||
|
||||
sViewLinkedItemManager.m_pA3DEntityRef = sMiscRefData.m_pEntity;
|
||||
sViewLinkedItemManager.m_POOwner = sMkpLinkedItemData.m_pTargetProductOccurrence;
|
||||
sViewLinkedItemManager.m_pMarkupLinkedItem = pMkpLinkedItemEntityRef;
|
||||
sViewLinkedItemManager.m_uiPOLevel = m_uiCurrentLevel;
|
||||
|
||||
A3DEEntityType sType;
|
||||
A3DEntityGetType(sMiscRefData.m_pEntity, &sType);
|
||||
if (sType == kA3DTypeMiscReferenceOnTopology)
|
||||
{
|
||||
A3DMiscReferenceOnTopologyData sTopoRefData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTopologyData, sTopoRefData);
|
||||
A3DMiscReferenceOnTopologyGet(sMiscRefData.m_pEntity, &sTopoRefData);
|
||||
sViewLinkedItemManager.m_pA3DEntityRef = sTopoRefData.m_pBrepData;
|
||||
sViewLinkedItemManager.m_bRefOnTopoItem = true;
|
||||
A3DMiscReferenceOnTopologyGet(NULL, &sTopoRefData);
|
||||
}
|
||||
else if (sType == kA3DTypeMiscReferenceOnCsysItem)
|
||||
{
|
||||
A3DMiscReferenceOnCsysItemData sA3DMiscReferenceOnCSYSITemData;
|
||||
A3D_INITIALIZE_DATA(A3DMiscReferenceOnCsysItemData, sA3DMiscReferenceOnCSYSITemData);
|
||||
A3DMiscReferenceOnCsysItemGet(sMiscRefData.m_pEntity, &sA3DMiscReferenceOnCSYSITemData);
|
||||
sViewLinkedItemManager.m_pA3DEntityRef = sA3DMiscReferenceOnCSYSITemData.m_pCoordinateSystem;
|
||||
A3DMiscReferenceOnCsysItemGet(NULL, &sA3DMiscReferenceOnCSYSITemData);
|
||||
}
|
||||
else
|
||||
sViewLinkedItemManager.m_pA3DEntityRef = sMiscRefData.m_pEntity;
|
||||
|
||||
A3DMiscEntityReferenceGet(NULL, &sMiscRefData);
|
||||
|
||||
m_asViewLinkedItemManager.push_back(sViewLinkedItemManager);
|
||||
}
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DMkpViewConnector& sConnector)
|
||||
{
|
||||
if ((m_psActivatedView == NULL) || (m_psActivatedView != sConnector.GetA3DEntity()))
|
||||
{
|
||||
if (!m_bTraverseActivatedViewOnly)
|
||||
VISITLEAVE;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
VISITLEAVE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void A3DVisitorContainer::push( A3DVisitor* psVisitor )
|
||||
{
|
||||
// vector<A3DVisitor*>::iterator iter =
|
||||
// search(m_apVisitor.begin(), m_apVisitor.end(), &psVisitor, &psVisitor+1);
|
||||
// if(iter == m_apVisitor.end())
|
||||
// {
|
||||
// m_apVisitorExcludedForDelete.push_back(psVisitor);
|
||||
// }
|
||||
m_apVisitor.push_back(psVisitor);
|
||||
if(!m_pTreeVisitor)
|
||||
m_pTreeVisitor = (A3DVisitor*)dynamic_cast<A3DTreeVisitor*>(psVisitor);//dynamic_cast return null if failed.
|
||||
}
|
||||
|
||||
|
||||
A3DVisitorContainer::~A3DVisitorContainer()
|
||||
{
|
||||
size_t uI, uNbVisitor = m_apVisitor.size();
|
||||
// vector<A3DVisitor*>::iterator iter;
|
||||
for(uI = 0; uI < uNbVisitor; uI++)
|
||||
// {
|
||||
// iter = search( m_apVisitorExcludedForDelete.begin(),
|
||||
// m_apVisitorExcludedForDelete.end(),
|
||||
// &m_apVisitor[uI],
|
||||
// &m_apVisitor[uI]+1);
|
||||
// if(iter == m_apVisitorExcludedForDelete.end())
|
||||
delete m_apVisitor[uI];
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
void* A3DVisitorContainer::FindInMap(const A3DEntity* pA3DEntity)
|
||||
{
|
||||
map<const A3DEntity*, void*>::iterator my_mapIter;
|
||||
my_mapIter = m_apA3DEntityYourEntityMap.find(pA3DEntity);
|
||||
if(my_mapIter == m_apA3DEntityYourEntityMap.end())
|
||||
return NULL;
|
||||
return my_mapIter->second;
|
||||
}
|
||||
|
||||
void A3DVisitorContainer::SetInMap(const A3DEntity* pA3DEntity, void* pYourEntity)
|
||||
{
|
||||
m_apA3DEntityYourEntityMap.insert(std::pair<const A3DEntity*, void*>(pA3DEntity, pYourEntity));
|
||||
}
|
||||
|
||||
A3DVisitor* A3DVisitorContainer::GetVisitorByName( std::string strName )
|
||||
{
|
||||
vector<A3DVisitor*>::iterator iter = m_apVisitor.begin();
|
||||
for( ; iter != m_apVisitor.end(); ++iter)
|
||||
if(strName.compare((*iter)->GetName()) == 0)
|
||||
return *iter;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
A3DVisitor* A3DVisitorContainer::GetTreeVisitor() const
|
||||
{
|
||||
return m_pTreeVisitor;
|
||||
}
|
||||
|
||||
void A3DVisitorContainer::ActivateEntityReference( A3DEntity const* pEntity )
|
||||
{
|
||||
// StepEntityReference
|
||||
size_t uI, uNbPushStepEntityRef = m_asStepEntityRefManager.size();
|
||||
for(uI = 0; uI < uNbPushStepEntityRef; uI++)
|
||||
{
|
||||
if(m_asStepEntityRefManager[uI].m_pA3DEntityRef == pEntity)
|
||||
{
|
||||
m_asStepEntityRefManager[uI].m_uiPushLevel = m_uiCurrentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
// ViewLinkedItem
|
||||
size_t uNbPushViewLMkpLinkedItem = m_asViewLinkedItemManager.size();
|
||||
for (uI = 0; uI < uNbPushViewLMkpLinkedItem; uI++)
|
||||
{
|
||||
A3DViewLinkedItemManager *pCurManager = &m_asViewLinkedItemManager[uI];
|
||||
if (pCurManager->m_pA3DEntityRef == pEntity &&
|
||||
( pCurManager->m_POOwner == NULL ||
|
||||
pCurManager->m_POOwner == pEntity ||
|
||||
pCurManager->m_POOwner == m_pCurrentPOFather
|
||||
)
|
||||
)
|
||||
{
|
||||
pCurManager->m_uiPushLevel = m_uiCurrentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void A3DVisitorContainer::DeactivateEntityReference( A3DEntity const* pEntity )
|
||||
{
|
||||
// StepEntityReference
|
||||
size_t uI, uNbPushStepEntityRef = m_asStepEntityRefManager.size();
|
||||
for(uI = 0; uI < uNbPushStepEntityRef; uI++)
|
||||
{
|
||||
if(m_asStepEntityRefManager[uI].m_pA3DEntityRef == pEntity)
|
||||
{
|
||||
m_asStepEntityRefManager[uI].m_uiPushLevel = ~0U;
|
||||
}
|
||||
}
|
||||
|
||||
// ViewLinkedItem
|
||||
size_t uNbPushViewLMkpLinkedItem = m_asViewLinkedItemManager.size();
|
||||
for (uI = 0; uI < uNbPushViewLMkpLinkedItem; uI++)
|
||||
{
|
||||
A3DViewLinkedItemManager *pCurManager = &m_asViewLinkedItemManager[uI];
|
||||
if (pCurManager->m_pA3DEntityRef == pEntity &&
|
||||
( pCurManager->m_POOwner == NULL ||
|
||||
pCurManager->m_POOwner == pEntity ||
|
||||
pCurManager->m_POOwner == m_pCurrentPOFather
|
||||
)
|
||||
)
|
||||
{
|
||||
pCurManager->m_uiPushLevel = ~0U;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
A3DStepEntityRefManager const* A3DVisitorContainer::GetActiveStepEntityRefManager(A3DEntity const * pEntity) const
|
||||
{
|
||||
A3DStepEntityRefManager const * psActivated = NULL;
|
||||
size_t uI, uNbPushStepEntityRef = m_asStepEntityRefManager.size();
|
||||
for(uI = 0; uI < uNbPushStepEntityRef; uI++)
|
||||
{
|
||||
A3DStepEntityRefManager const * psCurManager = &m_asStepEntityRefManager[uI];
|
||||
if (psCurManager->m_uiPushLevel!=~0U && (pEntity==NULL || psCurManager->m_pA3DEntityRef==pEntity))
|
||||
{
|
||||
if (!psActivated)
|
||||
psActivated = psCurManager;
|
||||
else if (psCurManager->IsFirst(*psActivated))
|
||||
psActivated = psCurManager;
|
||||
}
|
||||
}
|
||||
return psActivated;
|
||||
}
|
||||
|
||||
A3DViewLinkedItemManager const* A3DVisitorContainer::GetActiveViewLinkedItemManager(A3DEntity const * pEntity) const
|
||||
{
|
||||
A3DViewLinkedItemManager const * psActivated = NULL;
|
||||
|
||||
size_t uI, uNbPushViewMarkupLinkedItem = m_asViewLinkedItemManager.size();
|
||||
for (uI = 0; uI < uNbPushViewMarkupLinkedItem; uI++)
|
||||
{
|
||||
A3DViewLinkedItemManager const * psCurManager = &m_asViewLinkedItemManager[uI];
|
||||
if (psCurManager->m_uiPushLevel!=~0U && (pEntity==NULL || psCurManager->m_pA3DEntityRef==pEntity))
|
||||
{
|
||||
if (!psActivated)
|
||||
psActivated = psCurManager;
|
||||
else if (psCurManager->IsFirst(*psActivated))
|
||||
psActivated = psCurManager;
|
||||
}
|
||||
}
|
||||
|
||||
return psActivated;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONNECT_FEATURE
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFRMFeatureConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFRMFeatureConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFRMParameterConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFRMParameterConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFRMTreeConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFRMTreeConnector& sConnector)
|
||||
VISITLEAVE
|
||||
A3DStatus A3DVisitorContainer::visitEnter(const A3DFRMLinkedItemConnector& sConnector)
|
||||
VISITENTER
|
||||
A3DStatus A3DVisitorContainer::visitLeave(const A3DFRMLinkedItemConnector& sConnector)
|
||||
VISITLEAVE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,239 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef A3DVISITOR_CONTAINER
|
||||
#define A3DVISITOR_CONTAINER
|
||||
#include <map>
|
||||
#include "Visitors.h"
|
||||
|
||||
//This class allow to use several vistor when traversing 3DX Tree.
|
||||
//It allow also to exchange parameters between visitors
|
||||
|
||||
#define NODE_INSTANCES 0x0001
|
||||
|
||||
class A3DStepEntityRefManager
|
||||
{
|
||||
public:
|
||||
unsigned int m_uiPOLevel; // Level of creation
|
||||
unsigned int m_uiPushLevel; // if not ~0U , then is activated
|
||||
bool m_bRefOnTopoItem;;
|
||||
A3DMiscEntityReference* m_pStepEntityRef;
|
||||
A3DEntity* m_pA3DEntityRef;
|
||||
|
||||
A3DStepEntityRefManager() : m_uiPOLevel(~0U), m_uiPushLevel(~0U), m_pStepEntityRef(NULL), m_bRefOnTopoItem(false),
|
||||
m_pA3DEntityRef(NULL){}
|
||||
void GetMatrix();
|
||||
|
||||
bool IsFirst( A3DStepEntityRefManager const & sOther) const { return (m_uiPOLevel<sOther.m_uiPOLevel) || (m_uiPOLevel==sOther.m_uiPOLevel && m_uiPushLevel>sOther.m_uiPushLevel);}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class A3DViewLinkedItemManager
|
||||
|
||||
{
|
||||
public:
|
||||
unsigned int m_uiPOLevel;
|
||||
unsigned int m_uiPushLevel; // if not ~0U , then is activated
|
||||
bool m_bRefOnTopoItem;
|
||||
A3DMiscMarkupLinkedItem * m_pMarkupLinkedItem;
|
||||
A3DAsmProductOccurrence * m_POOwner;
|
||||
A3DEntity * m_pA3DEntityRef;
|
||||
|
||||
A3DViewLinkedItemManager() : m_uiPOLevel(~0U), m_uiPushLevel(~0U), m_pMarkupLinkedItem(NULL),m_bRefOnTopoItem(false),
|
||||
m_POOwner(NULL), m_pA3DEntityRef(NULL){}
|
||||
void GetMatrix();
|
||||
|
||||
bool IsFirst( A3DViewLinkedItemManager const & sOther) const { return (m_uiPOLevel<sOther.m_uiPOLevel) || (m_uiPOLevel==sOther.m_uiPOLevel && m_uiPushLevel>sOther.m_uiPushLevel);}
|
||||
};
|
||||
|
||||
class A3DVisitorContainer : public A3DVisitor
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4251) // Suppress the warning C4251 because it leads to have that kind of warning : "warning
|
||||
// C4251: 'A3DVisitorColorMaterials::m_apsCascadedAttribute' : class 'std::vector<_Ty>' needs to have dll-interface to
|
||||
// be used by clients of class 'A3DVisitorColorMaterials"
|
||||
// This is because of the "dllexport" on the visitor classes, as they use stl members and it seems that stl causes
|
||||
// warning with dllexport with microsoft compiler
|
||||
#endif // _MSC_VER
|
||||
|
||||
std::map<const A3DEntity*, void*> m_apA3DEntityYourEntityMap;
|
||||
std::vector<A3DVisitor*> m_apVisitor;
|
||||
bool m_bTraverseInstance;
|
||||
|
||||
A3DVisitor* m_pTreeVisitor;
|
||||
A3DAsmProductOccurrence const * m_pCurrentPOFather;
|
||||
A3DMkpView const * m_psActivatedView;
|
||||
bool m_bTraverseActivatedViewOnly;
|
||||
|
||||
std::vector<A3DStepEntityRefManager> m_asStepEntityRefManager;
|
||||
std::vector<A3DViewLinkedItemManager> m_asViewLinkedItemManager;
|
||||
unsigned int m_uiCurrentLevel;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif // _MSC_VER
|
||||
|
||||
public:
|
||||
A3DVisitorContainer(unsigned int uFlagElementToconnect = 0);
|
||||
|
||||
virtual ~A3DVisitorContainer();
|
||||
|
||||
void push( A3DVisitor* psVisitor);
|
||||
|
||||
//A3DConnector
|
||||
virtual A3DStatus visitEnter(const A3DConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
//Assmebly Tree
|
||||
#ifdef CONNECT_ASSEMBLY_TREE
|
||||
virtual A3DStatus visitEnter(const A3DModelFileConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DModelFileConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DProductOccurrenceConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DProductOccurrenceConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DPartConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DPartConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiConnector& sConnector);
|
||||
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiBrepModelConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiBrepModelConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiSetConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiSetConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DPolyRiBrepModelConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DPolyRiBrepModelConnector& sConnector);
|
||||
|
||||
#endif
|
||||
#ifdef CONNECT_PMI
|
||||
//Markup Tree
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationEntityConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationEntityConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationSetConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationSetConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationItemConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationItemConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMarkupConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupDimensionConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMarkupDimensionConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupGDTConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMarkupGDTConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupTessConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMarkupTessConnector& sConnector);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONNECT_BREP
|
||||
//Brep
|
||||
virtual A3DStatus visitEnter(const A3DBrepDataConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DBrepDataConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DConnexConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DConnexConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DShellConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DShellConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFaceConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFaceConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DLoopConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DLoopConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DCoEdgeConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DCoEdgeConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DEdgeConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DEdgeConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DUniqueVertexConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DUniqueVertexConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMultipleVertexConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMultipleVertexConnector& sConnector);
|
||||
#endif
|
||||
#ifdef CONNECT_MESH
|
||||
//Mesh
|
||||
virtual A3DStatus visitEnter(const A3DTessDataConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DTessDataConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFaceTessDataConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFaceTessDataConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupDatumConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMarkupDatumConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DWireTessDataConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DWireTessDataConnector& sConnector);
|
||||
|
||||
|
||||
#endif
|
||||
//Views
|
||||
#ifdef CONNECT_VIEWS
|
||||
virtual A3DStatus visitEnter(const A3DMkpViewConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DMkpViewConnector& sConnector);
|
||||
#endif
|
||||
#ifdef CONNECT_FEATURE
|
||||
virtual A3DStatus visitEnter(const A3DFRMFeatureConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMFeatureConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMParameterConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMParameterConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMTreeConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMTreeConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMLinkedItemConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DFRMLinkedItemConnector& sConnector);
|
||||
#endif
|
||||
|
||||
void* FindInMap(const A3DEntity* pA3DEntity);
|
||||
void SetInMap(const A3DEntity* pA3DEntity, void* pYourEntity);
|
||||
|
||||
std::vector<A3DVisitor*>& GetVisitor() { return m_apVisitor; }
|
||||
|
||||
|
||||
bool TraverseInstances() { return m_bTraverseInstance; }
|
||||
void SetTraverseInstance(bool bTraverseInstance) { m_bTraverseInstance = bTraverseInstance; }
|
||||
|
||||
A3DVisitor* GetVisitorByName(std::string strName);
|
||||
A3DVisitor* GetTreeVisitor() const;
|
||||
|
||||
void SetCurrentPoFather(A3DAsmProductOccurrence const * pCurrentPOFather) { m_pCurrentPOFather = pCurrentPOFather; }
|
||||
A3DAsmProductOccurrence const * GetCurrentPoFather() { return m_pCurrentPOFather; }
|
||||
|
||||
void SetActivateView(A3DMkpView const * psActivatedView) { m_psActivatedView = psActivatedView; }
|
||||
A3DMkpView const * GetActivatedView() { return m_psActivatedView; }
|
||||
|
||||
void SetTraverseActivatedViewOnly(bool bTraverseActivatedViewOnly) { m_bTraverseActivatedViewOnly = bTraverseActivatedViewOnly; }
|
||||
|
||||
// StepEntityReference and ViewLinkedItem treatment
|
||||
A3DStepEntityRefManager const* GetActiveStepEntityRefManager(A3DEntity const * pEntity) const;
|
||||
A3DViewLinkedItemManager const* GetActiveViewLinkedItemManager(A3DEntity const * pEntity) const;
|
||||
|
||||
void ActivateEntityReference( A3DEntity const* pEntity );
|
||||
void DeactivateEntityReference(A3DEntity const* pEntity);
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#include "VisitorTree.h"
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitEnter(const A3DRiBrepModelConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitLeave(const A3DRiBrepModelConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitEnter(const A3DRiSetConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitLeave(const A3DRiSetConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitEnter(const A3DRiConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitLeave(const A3DRiConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitEnter(const A3DPartConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitLeave(const A3DPartConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitEnter(const A3DProductOccurrenceConnector& sConnector)
|
||||
{
|
||||
if(m_uOption&NODE_INSTANCES)
|
||||
{
|
||||
m_pYourEntity = m_psContainer->FindInMap(sConnector.GetA3DEntity());
|
||||
if(m_pYourEntity)
|
||||
{
|
||||
((A3DProductOccurrenceConnector*) &sConnector)->SetIsInstanciated(true);
|
||||
}
|
||||
}
|
||||
|
||||
m_psContainer->SetInMap(sConnector.GetA3DEntity(),(void*) sConnector.GetA3DEntity() );
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus A3DTreeVisitor::visitLeave(const A3DProductOccurrenceConnector& /*sConnector*/)
|
||||
{
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void A3DTreeVisitor::SetYourEntity(void* /*pYourEnity*/)
|
||||
{
|
||||
//std::vector<A3DStepEntityRefManager>::iterator sIter;
|
||||
//for(sIter = m_asStepEntityRefManager.begin(); sIter != m_asStepEntityRefManager.end(); ++sIter)
|
||||
//{
|
||||
// if(sIter->m_bPushChildren == true)
|
||||
// sIter->m_apYourEntity.push_back(pYourEnity);
|
||||
//}
|
||||
//
|
||||
//return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef VISIT_TREE
|
||||
#define VISIT_TREE
|
||||
#include "Visitors.h"
|
||||
#include "VisitorContainer.h"
|
||||
|
||||
|
||||
class A3DConnector;
|
||||
class A3DVisitorContainer;
|
||||
|
||||
class A3DTreeVisitor : public A3DVisitor
|
||||
{
|
||||
friend class A3DVisitorContainer;
|
||||
protected:
|
||||
unsigned m_uOption;
|
||||
void* m_pYourEntity;
|
||||
|
||||
public:
|
||||
|
||||
A3DTreeVisitor(A3DVisitorContainer* psContainer = NULL) : A3DVisitor("Tree", psContainer)
|
||||
{
|
||||
m_uOption = 0;
|
||||
m_pYourEntity = NULL;
|
||||
}
|
||||
|
||||
virtual ~A3DTreeVisitor() {};
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiBrepModelConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiBrepModelConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiSetConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiSetConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DRiConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DPartConnector& sConnector );
|
||||
virtual A3DStatus visitLeave(const A3DPartConnector& sConnector);
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DProductOccurrenceConnector& sConnector);
|
||||
virtual A3DStatus visitLeave(const A3DProductOccurrenceConnector& sConnector);
|
||||
|
||||
|
||||
void SetYourEntity(void* pYourEnity);
|
||||
|
||||
};
|
||||
#endif
|
||||
206
exchange/exchangesource/DumpFeatureTree/Visitor/Visitors.h
Normal file
206
exchange/exchangesource/DumpFeatureTree/Visitor/Visitors.h
Normal file
@@ -0,0 +1,206 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef A3D_VISITOR
|
||||
#define A3D_VISITOR
|
||||
|
||||
//#define CONNECT_TRANSFO 0x0001
|
||||
//#define CONNECT_COLORS 0x0002
|
||||
//#define CONNECT_MESH 0x0004
|
||||
#define CONNECT_ASSEMBLY_TREE 0x008
|
||||
//#define CONNECT_BREP 0x0010
|
||||
//#define CONNECT_PMI 0x00020
|
||||
//#define CONNECT_VIEWS 0x00040
|
||||
#define CONNECT_FEATURE 0x00080
|
||||
|
||||
|
||||
#include "TreeTraverse.h"
|
||||
#ifdef CONNECT_PMI
|
||||
#include "MarkupTraverse.h"
|
||||
#endif
|
||||
#ifdef CONNECT_BREP
|
||||
#include "BrepTraverse.h"
|
||||
#endif
|
||||
#ifdef CONNECT_PMI
|
||||
#include "MarkupTraverse.h"
|
||||
#endif
|
||||
#ifdef CONNECT_MESH
|
||||
#include "TessConnector.h"
|
||||
#endif
|
||||
#ifdef CONNECT_VIEWS
|
||||
#include "ViewTraverse.h"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifndef CALL_A3D_FCTION
|
||||
#define CALL_A3D_FCTION(fctname, params) \
|
||||
fctname params
|
||||
#endif
|
||||
|
||||
#ifndef CHECK_RET_CALL_A3D_FCTION
|
||||
#define CHECK_RET_CALL_A3D_FCTION(fctname, params) \
|
||||
{ \
|
||||
if ((iRet = fctname params)!=A3D_SUCCESS) \
|
||||
{ /*__debugbreak();*/ return iRet; } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CHECK_RET
|
||||
#define CHECK_RET(function_call) \
|
||||
{\
|
||||
if ((iRet = function_call)!=A3D_SUCCESS) \
|
||||
return iRet; \
|
||||
}
|
||||
#endif
|
||||
|
||||
class A3DConnector;
|
||||
class A3DVisitorContainer;
|
||||
class A3DVisitor
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4251) // Suppress the warning C4251 because it leads to have that kind of warning : "warning
|
||||
// C4251: 'A3DVisitorColorMaterials::m_apsCascadedAttribute' : class 'std::vector<_Ty>' needs to have dll-interface to
|
||||
// be used by clients of class 'A3DVisitorColorMaterials"
|
||||
// This is because of the "dllexport" on the visitor classes, as they use stl members and it seems that stl causes
|
||||
// warning with dllexport with microsoft compiler
|
||||
#endif // _MSC_VER
|
||||
|
||||
protected:
|
||||
A3DVisitorContainer* m_psContainer;
|
||||
std::string m_strName;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif // _MSC_VER
|
||||
|
||||
public :
|
||||
A3DVisitor(std::string strName, A3DVisitorContainer* psContainer = NULL)
|
||||
: m_strName(strName), m_psContainer(psContainer){}
|
||||
|
||||
virtual ~A3DVisitor() {}
|
||||
|
||||
virtual std::string GetName() const { return m_strName; }
|
||||
|
||||
//Assembly
|
||||
#ifdef CONNECT_ASSEMBLY_TREE
|
||||
virtual A3DStatus visitEnter(const A3DModelFileConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DModelFileConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DProductOccurrenceConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DProductOccurrenceConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DPartConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DPartConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DRiConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiBrepModelConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DRiBrepModelConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DRiSetConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DRiSetConnector& /*sConnector*/) { return A3D_SUCCESS;}
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DPolyRiBrepModelConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DPolyRiBrepModelConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
#endif
|
||||
//Markup
|
||||
#ifdef CONNECT_PMI
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationEntityConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationEntityConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationSetConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationSetConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMkpAnnotationItemConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMkpAnnotationItemConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMarkupConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupDimensionConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMarkupDimensionConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupGDTConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMarkupGDTConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupDatumConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMarkupDatumConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMarkupTessConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMarkupTessConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
#endif
|
||||
//Brep
|
||||
#ifdef CONNECT_BREP
|
||||
virtual A3DStatus visitEnter(const A3DBrepDataConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DBrepDataConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DConnexConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DConnexConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DShellConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DShellConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFaceConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFaceConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DLoopConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DLoopConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DCoEdgeConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DCoEdgeConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DEdgeConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DEdgeConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DUniqueVertexConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DUniqueVertexConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DMultipleVertexConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMultipleVertexConnector&) { return A3D_SUCCESS; }
|
||||
#endif
|
||||
//Mesh
|
||||
#ifdef CONNECT_MESH
|
||||
virtual A3DStatus visitEnter(const A3DTessDataConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DTessDataConnector&) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFaceTessDataConnector&) {return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFaceTessDataConnector&) {return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DWireTessDataConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DWireTessDataConnector&) { return A3D_SUCCESS; }
|
||||
#endif
|
||||
//Views
|
||||
#ifdef CONNECT_VIEWS
|
||||
virtual A3DStatus visitEnter(const A3DMkpViewConnector&) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DMkpViewConnector&) { return A3D_SUCCESS; }
|
||||
#endif
|
||||
#ifdef CONNECT_FEATURE
|
||||
virtual A3DStatus visitEnter(const A3DFRMFeatureConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFRMFeatureConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMParameterConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFRMParameterConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMTreeConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFRMTreeConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
|
||||
virtual A3DStatus visitEnter(const A3DFRMLinkedItemConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
virtual A3DStatus visitLeave(const A3DFRMLinkedItemConnector& /*sConnector*/) { return A3D_SUCCESS; }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user