2025.6.1
This commit is contained in:
11
exchange/exchangesource/TranslateToPkParts/CMakeLists.txt
Normal file
11
exchange/exchangesource/TranslateToPkParts/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
add_executable(TranslateToPkParts)
|
||||
target_include_directories(TranslateToPkParts PRIVATE ${Parasolid_INCLUDE_DIRS} ./)
|
||||
target_link_libraries(TranslateToPkParts PRIVATE hoops_samples ${Parasolid_LIBRARIES})
|
||||
target_compile_definitions(TranslateToPkParts PRIVATE PARASOLID_INSTALL_DIR)
|
||||
|
||||
target_sources(TranslateToPkParts
|
||||
PRIVATE
|
||||
TranslateToPkParts.cpp
|
||||
frustrum_delta.c
|
||||
frustrum.c
|
||||
fg.c)
|
||||
@@ -1,6 +1,6 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* Copyright (c) 2010 - 2025 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
@@ -31,7 +31,7 @@ Common:
|
||||
- Set up the P_SCHEMA environment variable to your Parasolid schema folder (ending with \base\schema);
|
||||
- Copy pskernel.dll or libpskernel.so to your working directory (the HOOPS Exchange library binary folder).
|
||||
Windows-specific:
|
||||
- Provide the correct working directory, i.e. the HOOPS Exchange binary folder (i.e. ..\..\..\..\bin\win32);
|
||||
- Provide the correct working directory, i.e. the HOOPS Exchange binary folder (i.e. ..\..\..\..\bin\win64_v142);
|
||||
this setting is located in Project Properties --> Configuration Properties --> Debugging --> Working Directory;
|
||||
- Set up the command line
|
||||
- Then you can run it.
|
||||
@@ -52,6 +52,7 @@ Linux-specific:
|
||||
|
||||
#define INITIALIZE_A3D_API
|
||||
#include <A3DSDKIncludes.h>
|
||||
#include <hoops_license.h>
|
||||
|
||||
#include "../common.hpp"
|
||||
//######################################################################################################################
|
||||
@@ -224,6 +225,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
MY_PRINTF(" -sewingtolerance real: sewing tolerance for sew mode (1e-4 millimeters by default)\n");
|
||||
MY_PRINTF(" -iges 0|1 : export to iges file format 0 = off (by default), 1 = on\n");
|
||||
MY_PRINTF(" -step 0|1 : export to step file format 0 = off (by default), 1 = on\n");
|
||||
MY_PRINTF(" -multiproc 0|1 : unable multiprocessor computation 0 = off (by default), 1 = on\n");
|
||||
return A3D_ERROR;
|
||||
}
|
||||
|
||||
@@ -237,9 +239,9 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
sExport.m_sTranslateToPkPartsData.m_bDisjoinIfFaceFaceError = false;
|
||||
sExport.m_sTranslateToPkPartsData.m_bSew = true;
|
||||
sExport.m_sTranslateToPkPartsData.m_dSewingTolerance = 1e-4;
|
||||
sExport.m_sTranslateToPkPartsData.m_pcPSBodyShopPath = "";
|
||||
sExport.m_sTranslateToPkPartsData.m_pcPSBodyShopPath = const_cast<A3DUTF8Char*>("");
|
||||
sExport.m_sTranslateToPkPartsData.m_bUseColour2Attribute = true;
|
||||
sExport.m_sTranslateToPkPartsData.m_uiNbProc = 0; //getLogicalProcessor();
|
||||
sExport.m_sTranslateToPkPartsData.m_uiNbProc = 0;
|
||||
sExport.m_sExportParasolidData.m_bBStrictAssemblyStructure = true;
|
||||
|
||||
bool bStep = false;
|
||||
@@ -324,6 +326,11 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
case 0: bSewExchange = false; break;
|
||||
case 1: bSewExchange = true; break;
|
||||
}
|
||||
else if (!MY_STRCMP(ppcArgv[iArg], "-multiproc"))
|
||||
switch (MY_ATOI(ppcArgv[++iArg]))
|
||||
{
|
||||
case 1: sExport.m_sTranslateToPkPartsData.m_uiNbProc = getLogicalProcessor(); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -353,7 +360,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
#else
|
||||
const char* pcLibPath = "";
|
||||
#endif
|
||||
A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(pcLibPath);
|
||||
A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(pcLibPath, HOOPS_LICENSE);
|
||||
CHECK_RET(sHoopsExchangeLoader.m_eSDKStatus);
|
||||
|
||||
CHECK_RET(A3DDllSetCallbacksMemory(CheckMalloc, CheckFree));
|
||||
@@ -364,16 +371,16 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
char *workbuff = getenv("P_SCHEMA");
|
||||
if (workbuff)
|
||||
{
|
||||
PrintLogMessage("P_SCHEMA="); PrintLogMessage(workbuff); PrintLogMessage("\n");
|
||||
PrintConstLogMessage("P_SCHEMA="); PrintLogMessage(workbuff); PrintConstLogMessage("\n");
|
||||
}
|
||||
else
|
||||
PrintLogMessage("P_SCHEMA= missing\n");
|
||||
PrintConstLogMessage("P_SCHEMA= missing\n");
|
||||
|
||||
// initialize Parasolid
|
||||
PrintLogMessage("Initializing Parasolid...\n");
|
||||
PrintConstLogMessage("Initializing Parasolid...\n");
|
||||
if (!ParasolidInitialize())
|
||||
{
|
||||
PrintLogError(0, "Parasolid initialization failure\n");
|
||||
PrintConstLogError(0, "Parasolid initialization failure\n");
|
||||
return A3D_ERROR;
|
||||
}
|
||||
|
||||
@@ -403,7 +410,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
#endif
|
||||
|
||||
A3DExport sDirectExport(sDirectOutputPath);
|
||||
PrintLogMessage("Conversion...\n");
|
||||
PrintConstLogMessage("Conversion...\n");
|
||||
CHECK_RET(sHoopsExchangeLoader.Convert(sImport, sDirectExport));
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
@@ -414,7 +421,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
sImport.m_sLoadData.m_sSpecifics.m_sStep.m_bHealOrientations = true;
|
||||
sImport.m_sLoadData.m_sGeneral.m_eReadGeomTessMode = kA3DReadGeomAndTess;
|
||||
sImport.m_sLoadData.m_sTessellation.m_eTessellationLevelOfDetail = kA3DTessLODMedium;
|
||||
PrintLogMessage("TranslateToPkParts...\n");
|
||||
PrintConstLogMessage("TranslateToPkParts...\n");
|
||||
A3DStatus iRet = sHoopsExchangeLoader.Import(sImport);
|
||||
if (iRet != A3D_SUCCESS && iRet != A3D_LOAD_MISSING_COMPONENTS)
|
||||
CHECK_RET(iRet);
|
||||
@@ -440,11 +447,12 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
switch (sHoopsExchangeLoader.Export(sExport))
|
||||
{
|
||||
case A3D_SUCCESS: break;
|
||||
case A3D_HEPB_MISSING: PrintLogError(0, "Can't load HEPB library"); return A3D_ERROR;
|
||||
case A3D_PARASOLID_ERROR_970: PrintLogError(0, "Can't access Parasolid schema"); return A3D_ERROR;
|
||||
case A3D_BODYSHOP_MISSING: PrintLogError(0, "Can't load BodyShop library"); return A3D_ERROR;
|
||||
case A3D_WRITE_KEEPPARSEDENTITIES_DISABLED: PrintLogError(0, "KeepParsedEntities reading option must be enabled when using TranslateToPkParts"); return A3D_ERROR;
|
||||
default: PrintLogError(0, "TranslateToPkParts Failure"); return A3D_ERROR;
|
||||
case A3D_HEPB_MISSING: PrintConstLogError(0, "Can't load HEPB library"); return A3D_ERROR;
|
||||
case A3D_PARASOLID_ERROR_970: PrintConstLogError(0, "Can't access Parasolid schema"); return A3D_ERROR;
|
||||
case A3D_PARASOLID_ERROR_5022: PrintConstLogError(0, "Bad Parasolid version"); return A3D_ERROR;
|
||||
case A3D_BODYSHOP_MISSING: PrintConstLogError(0, "Can't load BodyShop library"); return A3D_ERROR;
|
||||
case A3D_WRITE_KEEPPARSEDENTITIES_DISABLED: PrintConstLogError(0, "KeepParsedEntities reading option must be enabled when using TranslateToPkParts"); return A3D_ERROR;
|
||||
default: PrintConstLogError(0, "TranslateToPkParts Failure"); return A3D_ERROR;
|
||||
}
|
||||
|
||||
A3DUTF8Char acOutPutKeyUTF8[_MAX_PATH];
|
||||
@@ -456,11 +464,11 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
|
||||
|
||||
if (!iNbPkParts)
|
||||
{
|
||||
PrintLogError(0, "No part to transmit\n");
|
||||
PrintConstLogError(0, "No part to transmit\n");
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
PrintLogMessage("PK_PART_transmit...\n");
|
||||
PrintConstLogMessage("PK_PART_transmit...\n");
|
||||
|
||||
PK_PART_transmit_o_t sTransmitOptions;
|
||||
PK_PART_transmit_o_m(sTransmitOptions);
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
<?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="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
@@ -24,37 +16,18 @@
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</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="PARA.props" />
|
||||
<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="PARA.props" />
|
||||
<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="PARA.props" />
|
||||
@@ -69,25 +42,6 @@
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(PARASOLID_INSTALL_DIR)\base;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PARASOLID_INSTALL_DIR=$(PARASOLID_INSTALL_DIR);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;pskernel.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(PARASOLID_INSTALL_DIR)\base\dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
@@ -110,27 +64,6 @@
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>$(PARASOLID_INSTALL_DIR)\base;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PARASOLID_INSTALL_DIR=$(PARASOLID_INSTALL_DIR);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;pskernel.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(PARASOLID_INSTALL_DIR)\base\dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
@@ -158,21 +91,15 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="fg.c" />
|
||||
<ClCompile Include="frustrum.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="frustrum_delta.c">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TranslateToPkParts.cpp">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">_UNICODE;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user