This commit is contained in:
ninja
2025-12-15 23:22:33 +08:00
parent 019570564b
commit 8782765fbc
809 changed files with 118753 additions and 18289 deletions

View File

@@ -0,0 +1,40 @@
add_executable(DrawingViewer)
target_include_directories(DrawingViewer PRIVATE ../Viewer)
find_package(OpenGL)
target_link_libraries(DrawingViewer PRIVATE hoops_samples
glut::glut)
if(APPLE)
target_link_libraries(DrawingViewer PRIVATE "-framework OpenGL") #We link directly to OpenGL because
#we have issue with OpenGL::OpenGL target with the Macosx4 builder (it doesn't find the OpenGL library)
#We should be able to use OpenGL target with the new builders
else()
target_link_libraries(DrawingViewer
PRIVATE
OpenGL::GL
OpenGL::GLU)
endif()
set(_srcs
Draw.cpp
drawing_collect.cpp
drawing_draw.cpp
drawing_main.cpp
drawing_main.h
drawing_parse.cpp
drawing_parse.h
callback_opengl.cpp
callback_opengl.h)
set(_viewer_srcs ../Viewer/trackball.cpp)
target_sources(DrawingViewer PRIVATE ${_srcs} ${_viewer_srcs})
source_group("" FILES ${_srcs})
source_group(viewer FILES ${_viewer_srcs})
# this is the hackiest solution in the world to override the "/WX" flag set in the hoops_samples interface in /final-package/samples/
if(MSVC)
target_compile_options(DrawingViewer PRIVATE /WX /WX-)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.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>
@@ -25,39 +17,20 @@
<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>
<UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v145</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</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" />
@@ -70,38 +43,6 @@
<PropertyGroup>
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\Viewer\glut\include;..\Viewer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling>Sync</ExceptionHandling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
<PrecompiledHeader />
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4505;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>glut32.lib;legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerboseLib</ShowProgress>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>..\Viewer\glut\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>if $(SolutionName) equ exchange copy /y ..\Viewer\glut\dll\glut32.dll .\$(Platform)\$(Configuration)\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
@@ -137,33 +78,6 @@
<Command>if $(SolutionName) equ exchange copy /y ..\Viewer\glut\dll\glut64.dll .\$(Platform)\$(Configuration)\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\Viewer\glut\include;..\Viewer;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4505;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>glut32.lib;legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>..\Viewer\glut\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>if $(SolutionName) equ exchange copy /y ..\Viewer\glut\dll\glut32.dll .\$(Platform)\$(Configuration)\</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
@@ -195,9 +109,9 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Viewer\Draw.cpp" />
<ClCompile Include="..\Viewer\trackball.cpp" />
<ClCompile Include="callback_opengl.cpp" />
<ClCompile Include="Draw.cpp" />
<ClCompile Include="drawing_collect.cpp" />
<ClCompile Include="drawing_draw.cpp" />
<ClCompile Include="drawing_main.cpp" />

View File

@@ -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
@@ -15,6 +15,7 @@ This file demonstrates how to programmatically visualize a PRC file from a basic
***********************************************************************************************************************/
#define A3DAPI_DEPRECATED
#include <A3DSDKIncludes.h>
#include "callback_opengl.h"
@@ -45,7 +46,7 @@ int& DisplayTriangleNormals() { return stiDisplayTriangleNormals; }
double& DisplayTriangleNormalLength() { return stdDisplayTriangleNormalLength; }
//######################################################################################################################
A3DStatus DrawInitCallbacks(A3DDrawCallbacksData* psCallbacks);
A3DStatus DrawInitCallbacks(deprecated_A3DDrawCallbacksData* psCallbacks);
//######################################################################################################################
static double stDeterminant4x4(double const m[16])
@@ -1210,9 +1211,9 @@ void OpenGL_Picture(const A3DGraphPictureData* /* psPictureData */)
}
//######################################################################################################################
A3DStatus OpenGL_SetAndInitCallBack(A3DDrawCallbacksData &sDrawCallbacksData)
A3DStatus OpenGL_SetAndInitCallBack(deprecated_A3DDrawCallbacksData &sDrawCallbacksData)
{
A3D_INITIALIZE_DATA(A3DDrawCallbacksData, sDrawCallbacksData);
A3D_INITIALIZE_DATA(deprecated_A3DDrawCallbacksData, sDrawCallbacksData);
sDrawCallbacksData.m_pfuncPushMatrix = OpenGL_PushMatrix;
sDrawCallbacksData.m_pfuncPopMatrix = OpenGL_PopMatrix;

View File

@@ -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
@@ -38,7 +38,7 @@ This file demonstrates how to programmatically visualize a PRC file from a basic
#endif
//######################################################################################################################
A3DStatus OpenGL_SetAndInitCallBack(A3DDrawCallbacksData &sDrawCallbacksData);
A3DStatus OpenGL_SetAndInitCallBack(deprecated_A3DDrawCallbacksData &sDrawCallbacksData);
//######################################################################################################################
void OpenGL_PushMatrix();

View File

@@ -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

View File

@@ -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
@@ -9,6 +9,7 @@
*
***********************************************************************************************************************/
#define A3DAPI_DEPRECATED
#include <A3DSDKIncludes.h>
#include "drawing_parse.h"
#include "callback_opengl.h"
@@ -26,7 +27,7 @@ typedef struct
} GLGlobalData;
//######################################################################################################################
static A3DDrawCallbacksData *st_psDrawCallBacks = NULL;
static deprecated_A3DDrawCallbacksData *st_psDrawCallBacks = NULL;
#define A3D_DRAW_CALL0(name) { if(st_psDrawCallBacks) st_psDrawCallBacks->m_pfunc##name(); }
#define A3D_DRAW_CALL1(name, p1) { if(st_psDrawCallBacks) st_psDrawCallBacks->m_pfunc##name(p1); }
#define A3D_DRAW_CALL2(name, p1, p2) { if(st_psDrawCallBacks) st_psDrawCallBacks->m_pfunc##name(p1, p2); }
@@ -448,7 +449,7 @@ A3DStatus stPostDrawDrawingSheet(A3DEntity* /*psEntity*/, A3DMiscCascadedAttribu
}
//######################################################################################################################
A3DStatus A3DDrawDrawing(A3DDrawingModel* pDrawingModel, A3DDrawCallbacksData* psCallbacks,
A3DStatus A3DDrawDrawing(A3DDrawingModel* pDrawingModel, deprecated_A3DDrawCallbacksData* psCallbacks,
std::vector<GLuint> &aGLSheetDisplayList, std::vector<A3DVector2dData>* paGLSheetSize,
bool bDrawMarkup)
{

View File

@@ -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
@@ -17,7 +17,9 @@ from a basic OpenGL program using HOOPS Exchange.
***********************************************************************************************************************/
#define INITIALIZE_A3D_API
#define A3DAPI_DEPRECATED
#include <A3DSDKIncludes.h>
#include <hoops_license.h>
#include "../common.hpp"
@@ -33,7 +35,7 @@ from a basic OpenGL program using HOOPS Exchange.
A3DStatus CollectDrawing(A3DAsmModelFile* pModelFile, std::vector<A3DDrawingModel*> &apDrawingModels);
//######################################################################################################################
A3DStatus A3DDrawDrawing(A3DDrawingModel* pDrawingModel, A3DDrawCallbacksData* psCallbacks,
A3DStatus A3DDrawDrawing(A3DDrawingModel* pDrawingModel, deprecated_A3DDrawCallbacksData* psCallbacks,
std::vector<GLuint> &aGLSheetDisplayList, std::vector<A3DVector2dData>* paGLSheetSize,
bool bDrawMarkup);
@@ -188,7 +190,7 @@ private:
};
//######################################################################################################################
static A3DDrawCallbacksData stsDrawCallbacksData;
static deprecated_A3DDrawCallbacksData stsDrawCallbacksData;
static A3DSDKHOOPSExchangeLoader* stpHOOPSExchangeLoader = NULL;
//######################################################################################################################
@@ -796,7 +798,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
// ### INITIALIZE HOOPS EXCHANGE
//
stpHOOPSExchangeLoader = new A3DSDKHOOPSExchangeLoader(_T(HOOPS_BINARY_DIRECTORY));
stpHOOPSExchangeLoader = new A3DSDKHOOPSExchangeLoader(_T(HOOPS_BINARY_DIRECTORY), HOOPS_LICENSE);
if (stpHOOPSExchangeLoader->m_eSDKStatus != A3D_SUCCESS)
{
A3DStatus eSDKStatus = stpHOOPSExchangeLoader->m_eSDKStatus;

View File

@@ -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

View File

@@ -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

View File

@@ -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