1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023829: Remove Graphic3dDemo sample app as obsolete

This commit is contained in:
san 2013-03-15 12:07:39 +04:00
parent f4aad56f97
commit 752259d839
75 changed files with 0 additions and 12306 deletions

View File

@ -1,111 +0,0 @@
# Microsoft Developer Studio Project File - Name="Graph" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=Graph - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Graph.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Graph.mak" CFG="Graph - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Graph - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "Graph - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Graph - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "win32/bin"
# PROP Intermediate_Dir "win32/obj"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GRAPH_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "inc" /I "$(QTDIR)\include" /I "$(QTDIR)\include\Qt" /D "NDEBUG" /D "QT_DLL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GRAPH_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib QtCore4.lib QtGui4.lib /nologo /dll /machine:I386 /libpath:"$(QTDIR)\lib"
!ELSEIF "$(CFG)" == "Graph - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Graph___Win32_Debug"
# PROP BASE Intermediate_Dir "Graph___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "win32/bind"
# PROP Intermediate_Dir "win32/objd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GRAPH_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "inc" /I "$(QTDIR)\include" /I "$(QTDIR)\include\Qt" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GRAPH_EXPORTS" /D "QT_DLL" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib QtCore4.lib QtGui4.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"$(QTDIR)\lib"
!ENDIF
# Begin Target
# Name "Graph - Win32 Release"
# Name "Graph - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\src\Graph.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\inc\Graph.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Graph"=.\Graph.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,21 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Graph", "Graph.vcproj", "{BA569B32-6C9B-4402-AF34-ACBD29A9DEBD}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{BA569B32-6C9B-4402-AF34-ACBD29A9DEBD}.Debug.ActiveCfg = Debug|Win32
{BA569B32-6C9B-4402-AF34-ACBD29A9DEBD}.Debug.Build.0 = Debug|Win32
{BA569B32-6C9B-4402-AF34-ACBD29A9DEBD}.Release.ActiveCfg = Release|Win32
{BA569B32-6C9B-4402-AF34-ACBD29A9DEBD}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Graph"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\win32/bin"
IntermediateDirectory=".\win32/obj"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="$(QTDIR)\include\QtCore,$(QTDIR)\include\QtGui,$(QTDIR)\include\Qt,$(QTDIR)\include,inc"
PreprocessorDefinitions="NDEBUG;QT_DLL;WIN32;_WINDOWS;_USRDLL;GRAPH_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\win32/obj/Graph.pch"
AssemblerListingLocation=".\win32/obj/"
ObjectFile=".\win32/obj/"
ProgramDataBaseFileName=".\win32/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib QtCore4.lib QtGui4.lib qtmain.lib"
OutputFile=".\win32/bin/Graph.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(QTDIR)\lib"
ProgramDatabaseFile=".\win32/bin/Graph.pdb"
ImportLibrary=".\win32/bin/Graph.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\win32/bin/Graph.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\win32/bind"
IntermediateDirectory=".\win32/objd"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(QTDIR)\include\QtCore,$(QTDIR)\include\QtGui,$(QTDIR)\include\Qt,$(QTDIR)\include,inc"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;GRAPH_EXPORTS;QT_DLL"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\win32/objd/Graph.pch"
AssemblerListingLocation=".\win32/objd/"
ObjectFile=".\win32/objd/"
ProgramDataBaseFileName=".\win32/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib QtCored4.lib QtGuid4.lib qtmaind.lib"
OutputFile=".\win32/bind/Graph.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(QTDIR)\lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\win32/bind/Graph.pdb"
ImportLibrary=".\win32/bind/Graph.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\win32/bind/Graph.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="src\Graph.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;QT_DLL;WIN32;_WINDOWS;_MBCS;_USRDLL;GRAPH_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;GRAPH_EXPORTS;QT_DLL;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="inc\Graph.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,605 +0,0 @@
# Microsoft Developer Studio Project File - Name="Graphic3dDemo" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Graphic3dDemo - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Graphic3dDemo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Graphic3dDemo.mak" CFG="Graphic3dDemo - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Graphic3dDemo - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Graphic3dDemo - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "win32/bin"
# PROP Intermediate_Dir "win32/obj"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "inc" /I "$(CASROOT)\inc" /I "$(QTDIR)\include" /I "$(QTDIR)\include\Qt" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "WNT" /D "QT_DLL" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "NDEBUG"
# ADD RSC /l 0x809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 TKernel.lib TKV3d.lib TKService.lib PTKernel.lib TKG3d.lib TKSTL.lib TKBrep.lib TKPrim.lib TKTopAlgo.lib TKG2d.lib TKMath.lib QtCore4.lib QtGui4.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Graph.lib /nologo /entry:"mainCRTStartup" /subsystem:windows /machine:I386 /libpath:"$(CASROOT)\win32\lib" /libpath:"$(QTDIR)\lib" /libpath:"win32\bin"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Graphic3dDemo___Win32_Debug"
# PROP BASE Intermediate_Dir "Graphic3dDemo___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "win32/bind"
# PROP Intermediate_Dir "win32/objd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "inc" /I "$(CASROOT)\inc" /I "$(QTDIR)\include" /I "$(QTDIR)\include\Qt" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "WNT" /D "QT_DLL" /D "GRAPH_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x809 /d "_DEBUG"
# ADD RSC /l 0x809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 TKernel.lib TKV3d.lib TKService.lib PTKernel.lib TKG3d.lib TKSTL.lib TKBrep.lib TKPrim.lib TKTopAlgo.lib TKG2d.lib TKMath.lib QtCore4.lib QtGui4.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Graph.lib /nologo /entry:"mainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"$(CASROOT)\win32\libd" /libpath:"$(QTDIR)\lib" /libpath:"win32\bind"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "Graphic3dDemo - Win32 Release"
# Name "Graphic3dDemo - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\src\Application.cxx
# End Source File
# Begin Source File
SOURCE=.\src\AutoTestDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\src\Document.cxx
# End Source File
# Begin Source File
SOURCE=.\src\Graphic3dDemo.cxx
# End Source File
# Begin Source File
SOURCE=.\src\MDIWindow.cxx
# End Source File
# Begin Source File
SOURCE=.\src\ObjectDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\src\ShapeDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\src\Sphere_BasicShape.cxx
# End Source File
# Begin Source File
SOURCE=.\src\Sphere_Sphere.cxx
# End Source File
# Begin Source File
SOURCE=.\src\Translate.cxx
# End Source File
# Begin Source File
SOURCE=.\src\View.cxx
# End Source File
# Begin Source File
SOURCE=.\src\ViewDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\src\ViewOperations.cxx
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\inc\Application.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Application.h
InputName=Application
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Application.h
InputName=Application
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\AutoTestDlg.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\AutoTestDlg.h
InputName=AutoTestDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\AutoTestDlg.h
InputName=AutoTestDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\Document.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Document.h
InputName=Document
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Document.h
InputName=Document
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\global.h
# End Source File
# Begin Source File
SOURCE=.\inc\Handle_Sphere_BasicShape.hxx
# End Source File
# Begin Source File
SOURCE=.\inc\Handle_Sphere_Sphere.hxx
# End Source File
# Begin Source File
SOURCE=.\inc\MDIWindow.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\MDIWindow.h
InputName=MDIWindow
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\MDIWindow.h
InputName=MDIWindow
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\ObjectDlg.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ObjectDlg.h
InputName=ObjectDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ObjectDlg.h
InputName=ObjectDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\ShapeDlg.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ShapeDlg.h
InputName=ShapeDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ShapeDlg.h
InputName=ShapeDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_BasicShape.hxx
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_BasicShape.ixx
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_BasicShape.jxx
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_Sphere.hxx
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_Sphere.ixx
# End Source File
# Begin Source File
SOURCE=.\inc\Sphere_Sphere.jxx
# End Source File
# Begin Source File
SOURCE=.\inc\Translate.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Translate.h
InputName=Translate
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\Translate.h
InputName=Translate
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\View.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\View.h
InputName=View
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\View.h
InputName=View
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\ViewDlg.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ViewDlg.h
InputName=ViewDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ViewDlg.h
InputName=ViewDlg
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\inc\ViewOperations.h
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ViewOperations.h
InputName=ViewOperations
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build - Moc'ing $(InputName).h ...
InputDir=.\inc
InputPath=.\inc\ViewOperations.h
InputName=ViewOperations
".\win32\inc\moc_$(InputName).cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\Sample_icons.ts
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build
InputPath=.\res\Sample_icons.ts
InputName=Sample_icons
".\win32\res\$(InputName).qm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)/bin/lrelease $(InputPath) -qm .\win32\res\$(InputName).qm
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build
InputPath=.\res\Sample_icons.ts
InputName=Sample_icons
".\win32\res\$(InputName).qm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)/bin/lrelease $(InputPath) -qm .\win32\res\$(InputName).qm
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\res\Sample_msg.ts
!IF "$(CFG)" == "Graphic3dDemo - Win32 Release"
# Begin Custom Build
InputPath=.\res\Sample_msg.ts
InputName=Sample_msg
".\win32\res\$(InputName).qm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)/bin/lrelease $(InputPath) -qm .\win32\res\$(InputName).qm
# End Custom Build
!ELSEIF "$(CFG)" == "Graphic3dDemo - Win32 Debug"
# Begin Custom Build
InputPath=.\res\Sample_msg.ts
InputName=Sample_msg
".\win32\res\$(InputName).qm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(QTDIR)/bin/lrelease $(InputPath) -qm .\win32\res\$(InputName).qm
# End Custom Build
!ENDIF
# End Source File
# End Group
# Begin Group "moc"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\win32\inc\moc_Application.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_AutoTestDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_Document.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_MDIWindow.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_ObjectDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_ShapeDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_Translate.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_View.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_ViewDlg.cxx
# End Source File
# Begin Source File
SOURCE=.\win32\inc\moc_ViewOperations.cxx
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Graphic3dDemo"=.\Graphic3dDemo.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,21 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Graphic3dDemo", "Graphic3dDemo.vcproj", "{9E15431A-031C-42CA-875B-284448550F66}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{9E15431A-031C-42CA-875B-284448550F66}.Debug.ActiveCfg = Debug|Win32
{9E15431A-031C-42CA-875B-284448550F66}.Debug.Build.0 = Debug|Win32
{9E15431A-031C-42CA-875B-284448550F66}.Release.ActiveCfg = Release|Win32
{9E15431A-031C-42CA-875B-284448550F66}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -1,893 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Graphic3dDemo"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\win32/bind"
IntermediateDirectory=".\win32/objd"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="inc,$(CASROOT)\inc,$(QTDIR)\include\QtCore,$(QTDIR)\include\QtGui,,$(QTDIR)\include\Qt,$(QTDIR)\include"
PreprocessorDefinitions="_DEBUG;WIN32;WNT;QT_DLL"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\win32/objd/Graphic3dDemo.pch"
AssemblerListingLocation=".\win32/objd/"
ObjectFile=".\win32/objd/"
ProgramDataBaseFileName=".\win32/objd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKernel.lib TKV3d.lib TKService.lib PTKernel.lib TKG3d.lib TKSTL.lib TKBrep.lib TKPrim.lib TKTopAlgo.lib TKG2d.lib TKMath.lib QtCored4.lib QtGuid4.lib qtmaind.lib odbc32.lib odbccp32.lib Graph.lib"
OutputFile=".\win32/bind/Graphic3dDemo.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(CASROOT)\win32\libd,$(QTDIR)\lib,win32\bind"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\win32/bind/Graphic3dDemo.pdb"
SubSystem="2"
EntryPointSymbol="mainCRTStartup"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\win32/bind/Graphic3dDemo.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\win32/bin"
IntermediateDirectory=".\win32/obj"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="inc,$(CASROOT)\inc,$(QTDIR)\include\QtCore,$(QTDIR)\include\QtGui,,$(QTDIR)\include\Qt,$(QTDIR)\include"
PreprocessorDefinitions="NDEBUG;WIN32;WNT;QT_DLL"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\win32/obj/Graphic3dDemo.pch"
AssemblerListingLocation=".\win32/obj/"
ObjectFile=".\win32/obj/"
ProgramDataBaseFileName=".\win32/obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="TKernel.lib TKV3d.lib TKService.lib PTKernel.lib TKG3d.lib TKSTL.lib TKBrep.lib TKPrim.lib TKTopAlgo.lib TKG2d.lib TKMath.lib QtCore4.lib QtGui4.lib qtmain.lib odbc32.lib odbccp32.lib Graph.lib"
OutputFile=".\win32/bin/Graphic3dDemo.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="$(CASROOT)\win32\lib,$(QTDIR)\lib,win32\bin"
ProgramDatabaseFile=".\win32/bin/Graphic3dDemo.pdb"
SubSystem="2"
EntryPointSymbol="mainCRTStartup"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\win32/bin/Graphic3dDemo.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="2057"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="src\Application.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\AutoTestDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\Document.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\Graphic3dDemo.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\MDIWindow.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\ObjectDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\ShapeDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\Sphere_BasicShape.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\Sphere_Sphere.cxx">
</File>
<File
RelativePath="src\Translate.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\View.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\ViewDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="src\ViewOperations.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="inc\Application.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\AutoTestDlg.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\Document.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\global.h">
</File>
<File
RelativePath="inc\Graph.h">
</File>
<File
RelativePath="inc\Handle_Sphere_BasicShape.hxx">
</File>
<File
RelativePath="inc\Handle_Sphere_Sphere.hxx">
</File>
<File
RelativePath="inc\MDIWindow.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\ObjectDlg.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\ShapeDlg.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\Sphere_BasicShape.hxx">
</File>
<File
RelativePath="inc\Sphere_BasicShape.ixx">
</File>
<File
RelativePath="inc\Sphere_BasicShape.jxx">
</File>
<File
RelativePath="inc\Sphere_Sphere.hxx">
</File>
<File
RelativePath="inc\Sphere_Sphere.ixx">
</File>
<File
RelativePath="inc\Sphere_Sphere.jxx">
</File>
<File
RelativePath="inc\Translate.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\View.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\ViewDlg.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
<File
RelativePath="inc\ViewOperations.h">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Moc&apos;ing $(InputName).h ..."
CommandLine="$(QTDIR)\bin\moc.exe $(InputDir)\$(InputName).h -o .\win32\inc\moc_$(InputName).cxx
"
Outputs=".\win32\inc\moc_$(InputName).cxx"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath=".\res\Sample_icons.ts">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generation $(InputName).qm..."
CommandLine="&quot;$(QTDIR)\bin\lrelease&quot; &quot;$(InputPath)&quot; -qm &quot;win32\res\$(InputName).qm&quot;
"
Outputs="win32\res\$(InputName).qm"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generation $(InputName).qm..."
CommandLine="&quot;$(QTDIR)\bin\lrelease&quot; &quot;$(InputPath)&quot; -qm &quot;win32\res\$(InputName).qm&quot;
"
Outputs="win32\res\$(InputName).qm"/>
</FileConfiguration>
</File>
<File
RelativePath=".\res\Sample_msg.ts">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generation $(InputName).qm..."
CommandLine="&quot;$(QTDIR)\bin\lrelease&quot; &quot;$(InputPath)&quot; -qm &quot;win32\res\$(InputName).qm&quot;"
Outputs="win32\res\$(InputName).qm"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generation $(InputName).qm..."
CommandLine="&quot;$(QTDIR)\bin\lrelease&quot; &quot;$(InputPath)&quot; -qm &quot;win32\res\$(InputName).qm&quot;"
Outputs="win32\res\$(InputName).qm"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="moc"
Filter="">
<File
RelativePath="win32\inc\moc_Application.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_AutoTestDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_Document.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_MDIWindow.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_ObjectDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_ShapeDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_Translate.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_View.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_ViewDlg.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="win32\inc\moc_ViewOperations.cxx">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,30 +0,0 @@
@ECHO OFF
call env.bat
IF NOT EXIST win32\obj goto QTSET
IF NOT EXIST "%QTDIR%" goto QTSET
goto QT
:QTSET
SET QTDIR=%ROOT%\3rdparty\win32\qt
SET PATH=%QTDIR%;%PATH%
:QT
if not exist %BIN_DIR%\Graphic3dDemo.exe goto ERR_EXE
@echo Starting Graphic3dDemo .....
start .\%BIN_DIR%\Graphic3dDemo.exe
GOTO END
:ERR_EXE
ECHO Executable %BIN_DIR%\Graphic3dDemo.exe not found."
ECHO Probably you didn't compile the application.
GOTO END
:END

View File

@ -1,19 +0,0 @@
@ECHO OFF
call env.bat
IF NOT DEFINED QTDIR GOTO ERR_QTDIR
REM *** To start build on MSVC6 ***
rem msdev.exe Graphic3dDemo.dsw
REM *** To start build on MSVC7 ***
start "%VS71COMNTOOLS%\..\IDE\devenv.exe" Graphic3dDemo.sln
GOTO END
:ERR_QTDIR
ECHO Environment variable "QTDIR" has not been defined. Abort.
GOTO END
:END

View File

@ -1,29 +0,0 @@
@ECHO OFF
call ../../../env.bat %1 %2 %3
IF NOT DEFINED CASROOT GOTO ERR_CASROOT
IF NOT EXIST "%CASROOT%\win32\bin\TKernel.dll" GOTO ERR_CASCADE
SET CASLIBS=%CASROOT%\win32\bin
SET ROOT=%CASROOT%\..
SET RES_DIR=win32\res
SET BIN_DIR=win32\bin
SET CSF_ResourcesDefaults=%RES_DIR%
SET PATH=%CASLIBS%;%QTDIR%\bin;%PATH%
GOTO END
:ERR_CASROOT
ECHO Environment variable "CASROOT" has not been defined. Abort.
EXIT
:ERR_CASCADE
ECHO Environment variable "CASROOT" defined incorrectly. Abort.
EXIT
:END

View File

@ -1,110 +0,0 @@
#ifndef APPLICATION_H
#define APPLICATION_H
#include <qmainwindow.h>
#include <qaction.h>
#include <qtoolbar.h>
#include <qmenu.h>
#include <qworkspace.h>
#include <qlist.h>
#include "MDIWindow.h"
#include "ViewDlg.h"
class Document;
class OutputWindow;
class QTextEdit;
class Application: public QMainWindow
{
Q_OBJECT
enum { FileNewId, FileQuitId, ViewToolId, ViewStatusId, HelpAboutId, OptimId,
AutoTestId, StopId, TileId, CascadeId };
enum { FileImportBREPId};
public:
Application();
~Application();
static QWorkspace* getWorkspace();
static Application* getApplication();
static QString getResourceDir();
static void startTimer();
static void stopTimer( int, const char*, bool addToGraph = true, int aOpt = -1 );
static void showTimer( const char* );
static void addResult(MDIWindow::ResultType, double);
void showMessage( QString& );
MDIWindow* getActiveMDI();
void updateActions();
void importBREP();
signals:
void sendQuit();
public slots:
void InitApp();
Document* onNewDocument();
void onCloseDocument( Document* theDoc );
void onViewToolBar();
void onViewStatusBar();
void onAbout();
void onQuit();
void onTranslate();
void onToggleOptim(bool);
void onAutoTest();
void onStop();
void updateWindowList();
void activateWindow();
void onEditViewProperties();
void updateViewDlg();
protected:
QWorkspace* workspace() const;
void keyPressEvent( QKeyEvent* e );
private slots:
void onWindowActivated( QWidget* );
private:
void createActions();
void createCCActions();
void createIEPopups();
private:
QWorkspace* myWorkSpace;
MDIWindow* myActiveMDI;
int myNbDocuments;
bool myIsDocuments;
QList<QAction*> myStdActions;
QList<QAction*> myCCActions;
QToolBar* myStdToolBar;
QMenu* myFilePopup;
QMenu* myImportPopup;
QMenu* myToolsMenu;
QMenu* myWinMenu;
OutputWindow* myOutput;
bool myEscPressed;
bool myStopPressed;
ViewDlg* myViewDlg;
};
class OutputWindow : public QWidget
{
public:
OutputWindow( QWidget* parent = 0 );
~OutputWindow();
void print( QString& );
private:
QTextEdit* myLineEdit;
int myLineCounter;
};
#endif

View File

@ -1,34 +0,0 @@
#ifndef AUTOTESTDLG_H
#define AUTOTESTDLG_H
#include <qdialog.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <qobject.h>
class AutoTestDlg : public QDialog
{
Q_OBJECT
public:
AutoTestDlg(QWidget * parent=0);
int getStartNbItems() { return myStartSpin->value(); }
int getStopNbItems() { return myStopSpin->value(); }
int getStep() { return myStepSpin->value(); }
int isText() { return myTeCheck->isChecked(); }
public slots:
void onStart();
void onCancel();
void setStartMaxValue(int i);
void checkStepSpinState();
void onText();
private:
QSpinBox* myStartSpin;
QSpinBox* myStopSpin;
QSpinBox* myStepSpin;
QCheckBox* myTeCheck;
};
#endif //#ifndef AUTOTESTDLG_H

View File

@ -1,52 +0,0 @@
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include <qobject.h>
#include <qlist.h>
#include "MDIWindow.h"
#include "ViewOperations.h"
#include <AIS_InteractiveContext.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_TypeOfView.hxx>
class Application;
class Document : public QObject
{
Q_OBJECT
public:
Document( int theIndex, Application* app );
~Document();
Application* getApplication();
Handle_AIS_InteractiveContext& getContext();
void removeView( MDIWindow* theView );
int countOfWindow();
void createMagView( int, int, int, int );
void createNewView( V3d_TypeOfView type = V3d_ORTHOGRAPHIC );
signals:
void sendCloseDocument( Document* );
public slots:
void onCloseView( MDIWindow* theView );
void onWireframe();
void onShading();
private:
Handle_V3d_Viewer Viewer( const Standard_CString aDisplay,
const Standard_ExtString aName,
const Standard_CString aDomain,
const Standard_Real ViewSize );
private:
Application* myApp;
QList<MDIWindow*> myViews;
Handle_V3d_Viewer myViewer;
Handle_AIS_InteractiveContext myContext;
ViewOperations* myOperations;
int myIndex;
int myNbViews;
};
#endif

View File

@ -1,634 +0,0 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the TEST_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// TEST_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef GRAPH_EXPORTS
#define GRAPH_API __declspec(dllexport)
#else
#define GRAPH_API __declspec(dllimport)
#endif
//////////////////////////////////////////////////////////////////////
// File : Graph.h
// Created : 26.03.02
// Author : Vadim SANDLER
//////////////////////////////////////////////////////////////////////
#if !defined(_Graph_h)
#define _Graph_h
#include <qwidget.h>
#include <qpixmap.h>
#include <qcursor.h>
#include <qlist.h>
#include <qsplitter.h>
#include <qlayout.h>
#include <qcolor.h>
#include <qrubberband.h>
//================================================================
// Class : GraphNode
// Description : graph node
//================================================================
class GRAPH_API GraphNode {
public:
// default constructor
GraphNode();
// constructor
GraphNode(const double x, const double y);
// copy constructor
GraphNode(const GraphNode& node);
// x coordinate
inline double x() const { return myX; }
// y coordinate
inline double y() const { return myY; }
// operator ==
bool operator== (const GraphNode& node);
// operator <
bool operator< (const GraphNode& node);
// operator >
bool operator> (const GraphNode& node);
// operator =
GraphNode& operator= (const GraphNode& node);
private:
// node coordinates
double myX;
double myY;
};
typedef QList<GraphNode*> NodeList;
class GraphView;
//================================================================
// Class : GraphItem
// Description : graph data set
//================================================================
class GRAPH_API GraphItem {
public:
// constructor
GraphItem(GraphView* parent, QString name = QString::null);
// destructor
virtual ~GraphItem();
// adds node
void addNode (GraphNode* node);
// adds node
void addNode (const double x, const double y);
// adds nodes
void addNodes(NodeList& nodes);
// removes node (and deletes it)
void removeNode(GraphNode* node);
// removes node by index (and deletes it)
void removeNode(int index);
// clears nodes
void clear ();
// gets number of nodes
int count () { return myNodes.count(); }
// returns true if list of nodes is empty
bool isEmpty () { return myNodes.isEmpty(); }
// returns true if item is valid, i.e. has valid attributes and not empty
bool isValid ();
// returns <Sorted> flag, true by default
bool isSorted() { return mySorted; }
// sets/clears <Sorted> flag (and reorders nodes)
void setSorted (bool sorted);
// gets node by index or NULL if index is out of range
GraphNode* getNode (const int index);
// gets node by index or NULL if index is out of range
GraphNode* operator[] (const int index);
// sets dynamic marker for item
void setMarker (const int marker,
const int color,
const int line);
// sets static marker for item
// (with own (NOT CHANGEABLE) marker, color and type line)
void setMarker (const int marker,
const QColor& color,
const Qt::PenStyle line);
// gets item name
QString getName() const { return myName; }
// sets item name
void setName(const QString& name) { myName = name; }
// returns true if item has own color
bool hasOwnColor() const { return myHasOwnColor; }
// returns true if item has own line type
bool hasOwnLine() const { return myHasOwnLine; }
// returns true if item has own marker
bool hasOwnMarker() const { return myHasOwnMarker; }
// sets own color
void setColor(const QColor& color);
// returns item's color
QColor getColor();
// sets own line
void setLine(const Qt::PenStyle line);
// returns item's line type
Qt::PenStyle getLine();
// sets own marker
void setMarker(const int marker);
// return item's marker type
int getMarker();
// gets marker attributes
void getMarker (int& marker, int& color, int& line);
protected:
// performs initialization
void init();
private:
// parent graph viewer
GraphView* myParent;
// node list
NodeList myNodes;
// name of item
QString myName;
// attributes type of line, color and marker
int myMarker;
int myColor;
int myLine;
// own marker
bool myHasOwnMarker;
// own color
bool myHasOwnColor;
QColor myOwnColor;
// own line type
bool myHasOwnLine;
Qt::PenStyle myOwnLine;
// <Sort coordinates> flag
bool mySorted;
};
typedef QList<GraphItem*> ItemList;
typedef QList<QColor> ColorList;
typedef QList<Qt::PenStyle> LineList;
typedef QList<int> IntList;
class GraphLegend;
//================================================================
// Class : GraphView
// Description : simple graph displayer
//================================================================
class GRAPH_API GraphView : public QWidget {
struct OperationButton {
Qt::MouseButtons button;
Qt::KeyboardModifiers modifier;
OperationButton(const Qt::MouseButtons btn = Qt::NoButton,
const Qt::KeyboardModifiers m = Qt::NoModifier)
: button(btn), modifier(m) {}
};
public:
enum ViewOperation { voNone, voZoom, voZoomX, voZoomY,
voPan, voPanX, voPanY, voRect };
enum GridMode { gmFixed, gmIntervals, gmFloating };
#ifdef DEB
void drawItem(QPainter* painter,
int pxMin,
int pxMax,
int pyMin,
int pyMax,
double xMin,
double xMax,
double yMin,
double yMax,
GraphItem* item);
#endif
/* ================== CONSTRUCTION/DESTRUCTION ================ */
// Constructor
GraphView(QWidget* parent = 0);
// Destructor
~GraphView();
/* ======================= OVERRIDED ========================== */
// event filter
bool eventFilter(QObject* object, QEvent* event);
/* ================== CURSORS HANDLING ======================== */
// sets cursor for certain view operation
void setOperationCursor (const ViewOperation operation,
const QCursor& newCursor);
// gets cursor for certain view operation
QCursor getOperationCursor (const ViewOperation operation) const;
/* =================== VIEW OPERATIONS ======================== */
// returns global <Enable operations> flag state
bool isOperationsEnabled() const { return myEnableGlobal; }
// globally enables/disables operations
void setOperationsEnabled(bool on);
// returns 'true' if view operation is enabled
bool isOperationEnabled (const ViewOperation operation) const;
// enables/disables view operation
void setOperationEnabled(const ViewOperation operation,
bool enable);
// sets operation key-mousebutton combination
void setOperationButton (const ViewOperation operation,
const Qt::MouseButtons button,
const Qt::KeyboardModifiers modifier);
// gets operation key-mousebutton combination
void getOperationButton (const ViewOperation operation,
Qt::MouseButtons& button,
Qt::KeyboardModifiers& modifier) const;
// tests for operation key-mousebutton combination
bool testOperation (const ViewOperation theOp,
const Qt::MouseButtons button,
const Qt::KeyboardModifiers modifier) const;
// tests key-mousebutton combination and returns view operation if any matches
ViewOperation testOperation (const Qt::MouseButtons button,
const Qt::KeyboardModifiers modifier) const;
// resets view : sets origin to 0.0 and scales to 1.0
void reset();
// fits viewer so display all data
void fitAll();
// fits viewer to display certain data
void fitData(const double xMin, const double xMax,
const double yMin, const double yMax);
// fits viewer to display certain data along horizontal axis
void fitDataX(const double xMin, const double xMax);
// fits viewer to display certain data along vertical axis
void fitDataY(const double yMin, const double yMax);
// performs pan operation by dx, dy pixels
void pan(const int dx, const int dy);
// performs zoom operation by dx, dy pixels
void zoom(const int dx, const int dy);
// starts view operation if it is enabled
void startViewOperation(const ViewOperation operation);
/* ================== ATRIBUTES HANDLING ====================== */
// enables/disables internal markers drawing
void showMarkers (bool show);
// enables/disables tooltips
void showTooltips (bool show);
// returns true is axes are shown
bool isAxesShown () const { return myShowAxes; }
// shows/hides axes
void showAxes (bool show);
// returns true is tick-marks are shown
bool isTickMarkShown () const { return myShowTickMarks; }
// shows/hides tick-marks
void showTickMark (bool show);
// returns true is title is shown
bool isTitleShown () const { return myShowTitle; }
// shows/hides title
void showTitle (bool show);
// gets graph title
const QString& getTitle () const { return myTitle; }
// sets graph title
void setTitle (const QString& title);
// returns true is axes titles are shown
bool isAxesTitleShown() const { return myShowAxesTitle; }
// shows/hides axis titles
void showAxesTitle (bool show);
// gets graph X axis title
const QString& getXTitle () const { return myXTitle; }
// sets graph X axis title
void setXTitle (const QString& title);
// gets graph Y axis title
const QString& getYTitle () const { return myYTitle; }
// sets graph Y axis title
void setYTitle (const QString& title);
// returns true is grid is shown
bool isGridShown () const { return myShowGrid; }
// shows/hides grid
void showGrid (bool show);
// sets grid step (FLOATING mode) for x, y axes,
// doesn't change step if it is <= 0
void setGridStep (const double x, const double y, bool turn = true);
// gets grid step (FLOATING mode) for x, y axes
// and returns true if grid mode is FLOATING
bool getGridStep (double& x, double& y) const;
// sets grid step (FIXED mode) for x, y axes in pixels,
// doesn't change step if it is less <= 0
void setFixedGridStep (const int x, const int y, bool turn = true);
// gets grid step (FIXED mode) for x, y axes in pixels
// and returns true if grid mode is FIXED
bool getFixedGridStep (int& x, int& y) const;
// sets number of grid intervals (INTERVALS mode) for x, y axes,
// doesn't change if <= 0
void setGridIntervals (const int xInt,
const int yInt,
bool turn = true);
// gets number of grid intervals (INTERVALS mode) for x, y axes,
// and returns true if grid mode is INTERVALS
bool getGridIntervals (int &xInt, int &yInt) const;
// returns grid mode [FIXED, INTERVALS, FLOATING]
GridMode getGridMode() const { return myGridMode; }
// switches grid mode [FIXED, INTERVALS, FLOATING]
void setGridMode(const GridMode mode);
// sets X axis scale
void setXScale(const double scale);
// gets X axis scale (data per pixel along X axis)
double getXScale() const { return myXScale; }
// sets Y axis scale
void setYScale(const double scale);
// gets Y axis scale (data per pixel along Y axis)
double getYScale() const { return myYScale; }
// sets X,Y axis scale
void setScale(const double scale);
// moves axes origin to point [x, y]
void setOrigin(const double x, const double y);
// gets axes origin
void getOrigin(double& x, double& y) const;
// changes backgroundColor, use it instead setBackgroundColor
void changeBackgroundColor(const int index = -1);
// gets main title font
QFont getTitleFont() { return myTitleFont; }
// sets main title font
void setTitleFont(QFont& font);
// gets axes title font
QFont getAxesTitleFont() { return myAxesTitleFont; }
// sets axes title font
void setAxesTitleFont(QFont& font);
// gets tick marks font
QFont getTickMarksFont() { return myTickMarksFont; }
// sets tick marks font
void setTickMarksFont(QFont& font);
// sets legend widget
void setLegend(GraphLegend* legend);
// gets legend widget
GraphLegend* getLegend() { return myLegend; }
// gets margins size
void getMargins(int& leftMargin,
int& rightMargin,
int& topMargin,
int& bottomMargin);
/* ================== DATA HANDLING =========================== */
// inserts item into list
void insertItem(GraphItem* item);
// removes item from list
void removeItem(const int index);
// clears data list
void clear();
// gets number of items
int getNbItems() { return myItems.count(); }
// gets item by index, returns NULL if index is out of range
GraphItem* getItem(const int index);
// returns index of item in data list
int findItem(GraphItem* item);
// sets/unsets items to be sorted by horizontal coordinate
void setSorted(bool sorted);
// gets full data range
void getRange(double& minX, double& minY,
double& maxX, double& maxY);
// gets current data range
void getCurrentRange(double& minX, double& minY,
double& maxX, double& maxY);
// returns number of colors provided
virtual int getNbColors();
// returns number of markers provided
virtual int getNbMarkers();
// returns number of type lines provided
virtual int getNbTypeLines();
// gets marker size (default is 9 pixels)
int getMarkerSize() { return myMarkerSize; }
// sets marker size (for good look it should be odd)
void setMarkerSize(const int size);
// gets color by index
virtual QColor getColor(const int color);
// gets line
virtual Qt::PenStyle getLine(const int line);
// returns true if colors seem to be the same (difference is less than gap)
static bool isSameColors(const QColor color1,
const QColor color2,
const int gap = 10);
protected:
/* ================== VIEW OPERATIONS HANDLING ================ */
// starts/finishes view operation
void startOperation (ViewOperation theOp);
// called on view operation starting
virtual void onStartOperation ();
// called on view operation finishing
virtual void onFinishOperation ();
// called on view operation running
virtual void onOperation (QPoint mousePos);
// called on mouse moving action (e.g. for highlighting item)
virtual void onMouseMove (QPoint mousePos);
// gets sensibility area size
int getSensibilitySize() const { return mySensibilitySize; }
// sets sensibility area size
void setSensibilitySize(const int size);
// handles tooltips for the view
QRect tip(const QPoint& point, QString& tipText);
/* ================== EVENTS HANDLING ========================= */
// MousePress event handler
void mousePressEvent (QMouseEvent* e);
// MouseMove event handler
void mouseMoveEvent (QMouseEvent* e);
// MouseRelease event handler
void mouseReleaseEvent (QMouseEvent* e);
// MouseDoubleClick event handler
void mouseDoubleClickEvent (QMouseEvent *e);
// KeyPress event handler
void keyPressEvent (QKeyEvent *e);
// KeyRelease event handler
void keyReleaseEvent (QKeyEvent *e);
// Resize event handler
void resizeEvent (QResizeEvent* e);
// Paint event handler
void paintEvent (QPaintEvent* e);
// global event handler
bool event (QEvent* e);
/* ================== DRAWING FUNCTIONS ======================= */
// gets graph painting area
virtual QRect getGraphRect ();
// draws grid
virtual void drawGrid (QPainter* painter);
// draws border (it is drawn when grid is not)
virtual void drawBorder (QPainter* painter);
// draws axes
virtual void drawAxes (QPainter* painter);
// draws tick marks
virtual void drawTickMarks(QPainter* painter);
// draws axes titles
virtual void drawAxesTitle(QPainter* painter);
// draws graph title
virtual void drawTitle(QPainter* painter);
// draws item
virtual void drawItem (QPainter* painter, GraphItem* item);
// draws marker at position
virtual void drawMarker(QPainter* painter,
const QPoint point,
const int marker,
const QColor& color);
// gets new unique marker for item if possible
virtual void getNextMarker(int& typeMarker, int& color, int& typeLine);
// checks if marker belongs to some entity
bool existMarker(const int typeMarker,
const int color,
const int typeLine);
private:
// returns true if line [x1,y1] - [x2,y2] intersect rectangle
static bool intersects(QRect rect, long x1, long y1, long x2, long y2);
// calculates points for grid and/or tick marks
void getTickPoints(IntList& xList, IntList& yList);
private:
// enable view operations flags
bool myEnableGlobal;
bool myEnableRect;
bool myEnablePan;
bool myEnablePanX;
bool myEnablePanY;
bool myEnableZoom;
bool myEnableZoomX;
bool myEnableZoomY;
// current view operation
ViewOperation myOperation;
// current view operation
ViewOperation myForcedOp;
// sensibility size for rect selection operation
int mySensibilitySize;
// view operation points (second is used for rubber rectangle)
QPoint myPoint;
QPoint myOtherPoint;
// view operations key-mouse combinations
OperationButton myRectKey;
OperationButton myPanKey;
OperationButton myPanXKey;
OperationButton myPanYKey;
OperationButton myZoomKey;
OperationButton myZoomXKey;
OperationButton myZoomYKey;
// state cursors
QCursor myDefCursor;
QCursor myRectCursor;
QCursor myPanCursor;
QCursor myPanXCursor;
QCursor myPanYCursor;
QCursor myZoomCursor;
QCursor myZoomXCursor;
QCursor myZoomYCursor;
// axes origin (left-bottom point)
GraphNode myOrigin;
// X axis scale
double myXScale;
double myYScale;
// draw flags
bool myShowAxes;
bool myShowTitle;
bool myShowAxesTitle;
bool myShowTickMarks;
bool myShowGrid;
bool myShowTooltips;
bool myShowMarkers;
// grid mode
GridMode myGridMode;
// fixed grid size
int myGridPStepX;
int myGridPStepY;
// floating grid size
double myGridStepX;
double myGridStepY;
// number of grid intervals
int myGridIntX;
int myGridIntY;
// marker size
int myMarkerSize;
// titles
QString myTitle;
QString myXTitle;
QString myYTitle;
// colors
ColorList myColors;
// line types
LineList myLines;
// data
ItemList myItems;
GraphLegend* myLegend;
// fonts
QFont myTitleFont;
QFont myAxesTitleFont;
QFont myTickMarksFont;
// rubber band
QRubberBand* myRubberBand;
friend class GraphLegend;
};
//================================================================
// Class : GraphLegend
// Description : Legend widget
//================================================================
class GRAPH_API GraphLegend : public QWidget {
public:
// constructor
GraphLegend(QWidget* parent, GraphView* graph);
// updates legend contents
void updateMe();
// shows/hides legend title
void showTitle(bool show);
// sets legend title
void setTitle(const QString& title);
// gets legend title
QString getTitle() const { return myTitle; }
// returns graph item which is below the point or NULL
GraphItem* itemAt(const QPoint& point);
// gets legend title font
QFont getTitleFont() { return myTitleFont; }
// sets legend title font
void setTitleFont(QFont& font);
// gets item font
QFont getItemFont() { return font(); }
// sets item font
void setItemFont(QFont& font);
// get minimum size
QSize minimumSizeHint() const;
QSize sizeHint() const;
protected:
// handles tooltips for the view
QRect tip(const QPoint& point, QString& tipText);
// returns rect which contains item's name
QRect textRect(GraphItem* item, QString& tipText);
// draws contents
void paintEvent(QPaintEvent* e);
// global event handler
bool event(QEvent* e);
private:
// parent graph
GraphView* myGraph;
bool myShowTitle;
QString myTitle;
QFont myTitleFont;
};
//================================================================
// Class : GraphSplitView
// Description : Graph view with a legend in splitted window
//================================================================
class GRAPH_API GraphSplitView : public QWidget {
public:
// constructor
GraphSplitView(QWidget* parent);
// returns graph view
GraphView* getGraph() { return myGraph; }
// returns legend view
GraphLegend* getLegend();
// shows/hides legend view
void showLegend(bool show);
// returns true if legend is being shown
bool isLegendShown();
private:
// graph view
GraphView* myGraph;
// splitter window
QSplitter* mySplitter;
};
#endif // !defined(_Graph_h)

View File

@ -1,85 +0,0 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
#ifndef _Handle_Sphere_BasicShape_HeaderFile
#define _Handle_Sphere_BasicShape_HeaderFile
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_AIS_Shape_HeaderFile
#include <Handle_AIS_Shape.hxx>
#endif
class Standard_Transient;
class Handle_Standard_Type;
class Handle(AIS_Shape);
class Sphere_BasicShape;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(Sphere_BasicShape);
class Handle(Sphere_BasicShape) : public Handle(AIS_Shape) {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
Handle(Sphere_BasicShape)():Handle(AIS_Shape)() {}
Handle(Sphere_BasicShape)(const Handle(Sphere_BasicShape)& aHandle) : Handle(AIS_Shape)(aHandle)
{
}
Handle(Sphere_BasicShape)(const Sphere_BasicShape* anItem) : Handle(AIS_Shape)((AIS_Shape *)anItem)
{
}
Handle(Sphere_BasicShape)& operator=(const Handle(Sphere_BasicShape)& aHandle)
{
Assign(aHandle.Access());
return *this;
}
Handle(Sphere_BasicShape)& operator=(const Sphere_BasicShape* anItem)
{
Assign((Standard_Transient *)anItem);
return *this;
}
Sphere_BasicShape* operator->()
{
return (Sphere_BasicShape *)ControlAccess();
}
Sphere_BasicShape* operator->() const
{
return (Sphere_BasicShape *)ControlAccess();
}
Standard_EXPORT ~Handle(Sphere_BasicShape)();
Standard_EXPORT static const Handle(Sphere_BasicShape) DownCast(const Handle(Standard_Transient)& AnObject);
};
#endif

View File

@ -1,85 +0,0 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
#ifndef _Handle_Sphere_Sphere_HeaderFile
#define _Handle_Sphere_Sphere_HeaderFile
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Sphere_BasicShape_HeaderFile
#include <Handle_Sphere_BasicShape.hxx>
#endif
class Standard_Transient;
class Handle_Standard_Type;
class Handle(Sphere_BasicShape);
class Sphere_Sphere;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(Sphere_Sphere);
class Handle(Sphere_Sphere) : public Handle(Sphere_BasicShape) {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
Handle(Sphere_Sphere)():Handle(Sphere_BasicShape)() {}
Handle(Sphere_Sphere)(const Handle(Sphere_Sphere)& aHandle) : Handle(Sphere_BasicShape)(aHandle)
{
}
Handle(Sphere_Sphere)(const Sphere_Sphere* anItem) : Handle(Sphere_BasicShape)((Sphere_BasicShape *)anItem)
{
}
Handle(Sphere_Sphere)& operator=(const Handle(Sphere_Sphere)& aHandle)
{
Assign(aHandle.Access());
return *this;
}
Handle(Sphere_Sphere)& operator=(const Sphere_Sphere* anItem)
{
Assign((Standard_Transient *)anItem);
return *this;
}
Sphere_Sphere* operator->()
{
return (Sphere_Sphere *)ControlAccess();
}
Sphere_Sphere* operator->() const
{
return (Sphere_Sphere *)ControlAccess();
}
Standard_EXPORT ~Handle(Sphere_Sphere)();
Standard_EXPORT static const Handle(Sphere_Sphere) DownCast(const Handle(Standard_Transient)& AnObject);
};
#endif

View File

@ -1,63 +0,0 @@
#ifndef MDIWINDOW_H
#define MDIWINDOW_H
#include <qmainwindow.h>
#include <V3d_View.hxx>
#include <V3d_TypeOfView.hxx>
#include "ViewOperations.h"
class Document;
class View;
class GraphSplitView;
class MDIWindow : public QMainWindow
{
Q_OBJECT
friend class Document;
public:
enum ResultType
{
DisplayNonOpt, DisplayOpt, UpdateNonOpt, UpdateOpt, Undefined
};
public:
MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView );
~MDIWindow();
Document* getDocument();
int getDisplayMode();
void defineMagView();
Handle_V3d_View& getView();
void activateAction( ViewOperations::Action action );
void addResult(ResultType, int, double);
bool eventFilter(QObject*, QEvent*);
void graphPopup(const QPoint&);
signals:
void message( const QString&, int );
void sendCloseView( MDIWindow* theView );
public slots:
void closeEvent( QCloseEvent* e );
void setCursor( const QCursor& );
void onGraphClear();
void onGraphFitAll();
protected:
void createViewActions();
void createGraphActions();
private:
Document* myDocument;
View* myView;
GraphSplitView* myGraphView;
QMenu* myGraphPopup;
ViewOperations* myOperations;
};
#endif

View File

@ -1,68 +0,0 @@
#ifndef OBJECTDLG_H
#define OBJECTDLG_H
#include <qdialog.h>
#include <Aspect_TypeOfDegenerateModel.hxx>
#include <V3d_View.hxx>
#include <AIS_InteractiveContext.hxx>
class QLabel;
class QComboBox;
class QSpinBox;
class ObjectDlg : public QDialog
{
Q_OBJECT
enum { SolidEdgeId, DashEdgeId, DotEdgeId, DotDashEdgeId };
enum { NoDegId, TinyDegId, WireDegId, MarkerDegId, BBoxDegId };
public:
ObjectDlg( QWidget* parent, Handle(V3d_View)&, Handle(AIS_InteractiveContext)& );
virtual ~ObjectDlg();
private slots:
void onOk();
void onCancel();
void onHelp();
void onShowEdges( bool );
void onDegenerateModel( int );
void onDegRatio( int );
void onEdgeStyle( int );
void onEdgeWidth( int );
void onAutoApply( bool );
protected:
void showEvent ( QShowEvent* );
private:
void updateEdgeAspect( bool edgeStyle );
/* if edgeStyle - true then type of line will be changed;
width of line will be changed otherwise
*/
void updateDegenerationModel();
private:
/* ----- common section ----- */
bool myAutoApply;
Handle_V3d_View myView;
Handle_AIS_InteractiveContext myContext;
/* ----- edge section ----- */
QLabel* myEdgeStyle;
QLabel* myEdgeWidth;
QComboBox* myEdgeBox;
QSpinBox* myEdgeSpin;
int myCurrentEdgeStyle;
float myCurrentEdgeWidth;
/* ----- degeneration section ----- */
Aspect_TypeOfDegenerateModel myDegModel;
int myCurrentDegModel;
float myCurrentDegRatio;
QLabel* myDegModelLabel;
QLabel* myDegRatioLabel;
QComboBox* myDegModelBox;
QSpinBox* myDegRatioSpin;
};
#endif

View File

@ -1,67 +0,0 @@
#ifndef SHAPEDLG_H
#define SHAPEDLG_H
#include <qdialog.h>
#include <Aspect_TypeOfDegenerateModel.hxx>
#include <V3d_View.hxx>
#include <AIS_InteractiveContext.hxx>
//#include <GUIA_Sphere.hxx>
#include <Sphere_Sphere.hxx>
class QLabel;
class QComboBox;
class QSpinBox;
class QDoubleSpinBox;
class QCheckBox;
class ShapeDlg : public QDialog
{
Q_OBJECT
enum { SolidEdgeId, DashEdgeId, DotEdgeId, DotDashEdgeId };
enum { NoDegId, TinyDegId, WireDegId, MarkerDegId, BBoxDegId };
public:
ShapeDlg( QWidget* parent, Handle(V3d_View)&, Handle(AIS_InteractiveContext)& );
virtual ~ShapeDlg();
private slots:
void onOk();
void onCancel();
void onHelp();
void onRadiusChanged( double );
void onItemsChanged( int );
void onPanesChanged( int );
void onDeflectionChanged( double );
void onText();
void onPositionChanged();
protected:
void closeEvent ( QCloseEvent* );
void showEvent ( QShowEvent* );
private:
void updateSphere();
private:
/* ----- common section ----- */
Handle_V3d_View myView;
Handle_AIS_InteractiveContext myContext;
Handle_Sphere_Sphere myShape;
double myRadius;
double myDeflection;
int myNbPanes;
int myNbItems;
QDoubleSpinBox* myDefSpin;
QSpinBox* myPanesSpin;
QSpinBox* myItemsSpin;
QDoubleSpinBox* myXSpin;
QDoubleSpinBox* myYSpin;
QDoubleSpinBox* myZSpin;
QCheckBox* myVNormal;
QCheckBox* myVColor;
QCheckBox* myVTexel;
QCheckBox* myText;
};
#endif

View File

@ -1,107 +0,0 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#ifndef _Sphere_BasicShape_HeaderFile
#define _Sphere_BasicShape_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Sphere_BasicShape_HeaderFile
#include <Handle_Sphere_BasicShape.hxx>
#endif
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <AIS_Shape.hxx>
class TopoDS_Shape;
class gp_Pnt;
class Sphere_BasicShape : public AIS_Shape {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT Sphere_BasicShape(const TopoDS_Shape& aShape,const Standard_Real aDeflection,const Standard_Boolean hasVNormals,const Standard_Boolean hasVColors,const Standard_Boolean hasVTexels);
Standard_EXPORT void SetPosition(const gp_Pnt& aPosition) ;
Standard_EXPORT void SetVNormals(const Standard_Boolean aFlag) ;
Standard_EXPORT void SetVColors(const Standard_Boolean aFlag) ;
Standard_EXPORT void SetVTexels(const Standard_Boolean aFlag) ;
Standard_EXPORT void SetDeflection(const Standard_Real aValue) ;
Standard_EXPORT gp_Pnt Position() const;
Standard_EXPORT Standard_Boolean VNormalsFlag() const;
Standard_EXPORT Standard_Boolean VColorsFlag() const;
Standard_EXPORT Standard_Boolean VTexelsFlag() const;
Standard_EXPORT Standard_Real Deflection() const;
Standard_EXPORT ~Sphere_BasicShape();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& Sphere_BasicShape_Type_();
Standard_EXPORT const Handle_Standard_Type& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
Standard_Real myDeflection;
Standard_Boolean myVNormalsFlag;
Standard_Boolean myVColorsFlag;
Standard_Boolean myVTexelsFlag;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -1,77 +0,0 @@
// File generated by CPPExt (Transient)
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#include <Sphere_BasicShape.jxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
Sphere_BasicShape::~Sphere_BasicShape() {}
Standard_EXPORT Handle_Standard_Type& Sphere_BasicShape_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_Shape);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_Shape);
static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_InteractiveObject);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_InteractiveObject);
static Handle_Standard_Type aType3 = STANDARD_TYPE(SelectMgr_SelectableObject);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(SelectMgr_SelectableObject);
static Handle_Standard_Type aType4 = STANDARD_TYPE(PrsMgr_PresentableObject);
if ( aType4.IsNull()) aType4 = STANDARD_TYPE(PrsMgr_PresentableObject);
static Handle_Standard_Type aType5 = STANDARD_TYPE(MMgt_TShared);
if ( aType5.IsNull()) aType5 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType6 = STANDARD_TYPE(Standard_Transient);
if ( aType6.IsNull()) aType6 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,NULL};
static Handle_Standard_Type _aType = new Standard_Type("Sphere_BasicShape",
sizeof(Sphere_BasicShape),
1,
(Standard_Address)_Ancestors,
(Standard_Address)NULL);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(Sphere_BasicShape) Handle(Sphere_BasicShape)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(Sphere_BasicShape) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(Sphere_BasicShape))) {
_anOtherObject = Handle(Sphere_BasicShape)((Handle(Sphere_BasicShape)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& Sphere_BasicShape::DynamicType() const
{
return STANDARD_TYPE(Sphere_BasicShape) ;
}
Standard_Boolean Sphere_BasicShape::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(Sphere_BasicShape) == AType || AIS_Shape::IsKind(AType));
}
Handle_Sphere_BasicShape::~Handle_Sphere_BasicShape() {}

View File

@ -1,3 +0,0 @@
#include <TopoDS_Shape.hxx>
#include <gp_Pnt.hxx>
#include <Sphere_BasicShape.hxx>

View File

@ -1,107 +0,0 @@
// File generated by CPPExt (Transient)
//
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#ifndef _Sphere_Sphere_HeaderFile
#define _Sphere_Sphere_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Sphere_Sphere_HeaderFile
#include <Handle_Sphere_Sphere.hxx>
#endif
#include <Standard_Real.hxx>
#include <Sphere_BasicShape.hxx>
#include <Standard_Boolean.hxx>
#include <Handle_PrsMgr_PresentationManager3d.hxx>
#include <Handle_Prs3d_Presentation.hxx>
#include <Standard_Integer.hxx>
class gp_Pnt;
class PrsMgr_PresentationManager3d;
class Prs3d_Presentation;
class Sphere_Sphere : public Sphere_BasicShape {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT Sphere_Sphere(const gp_Pnt& aPosition,const Standard_Real aRadius,const Standard_Real aDeflection = 1.0,const Standard_Boolean hasVNormals = Standard_True,const Standard_Boolean hasVColors = Standard_False,const Standard_Boolean hasVTexels = Standard_False, const Standard_Boolean hasText = Standard_False, const Standard_Boolean isOptText = Standard_False);
Standard_EXPORT void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
Standard_EXPORT void SetRadius(const Standard_Real aValue) ;
Standard_EXPORT Standard_Real Radius() const;
Standard_EXPORT static Standard_Integer NbPanes(const Standard_Real aRadius,const Standard_Real aDeflection) ;
Standard_EXPORT static Standard_Integer NbPanes(const Standard_Integer nbItems) ;
Standard_EXPORT static Standard_Integer NbItems(const Standard_Integer nbPanes) ;
Standard_EXPORT static Standard_Real Deflection(const Standard_Real aRadius,const Standard_Integer nbPanes) ;
Standard_EXPORT ~Sphere_Sphere();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& Sphere_Sphere_Type_();
Standard_EXPORT const Handle_Standard_Type& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Real myRadius;
Standard_Boolean myText;
Standard_Boolean myOptText;
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -1,79 +0,0 @@
// File generated by CPPExt (Transient)
// Copyright (C) 1991,1995 by
//
// MATRA DATAVISION, FRANCE
//
// This software is furnished in accordance with the terms and conditions
// of the contract and with the inclusion of the above copyright notice.
// This software or any other copy thereof may not be provided or otherwise
// be made available to any other person. No title to an ownership of the
// software is hereby transferred.
//
// At the termination of the contract, the software and all copies of this
// software must be deleted.
//
#include <Sphere_Sphere.jxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
Sphere_Sphere::~Sphere_Sphere() {}
Standard_EXPORT Handle_Standard_Type& Sphere_Sphere_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(Sphere_BasicShape);
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(Sphere_BasicShape);
static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_Shape);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_Shape);
static Handle_Standard_Type aType3 = STANDARD_TYPE(AIS_InteractiveObject);
if ( aType3.IsNull()) aType3 = STANDARD_TYPE(AIS_InteractiveObject);
static Handle_Standard_Type aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
if ( aType4.IsNull()) aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
static Handle_Standard_Type aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
if ( aType5.IsNull()) aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
static Handle_Standard_Type aType6 = STANDARD_TYPE(MMgt_TShared);
if ( aType6.IsNull()) aType6 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType7 = STANDARD_TYPE(Standard_Transient);
if ( aType7.IsNull()) aType7 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL};
static Handle_Standard_Type _aType = new Standard_Type("Sphere_Sphere",
sizeof(Sphere_Sphere),
1,
(Standard_Address)_Ancestors,
(Standard_Address)NULL);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(Sphere_Sphere) Handle(Sphere_Sphere)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(Sphere_Sphere) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(Sphere_Sphere))) {
_anOtherObject = Handle(Sphere_Sphere)((Handle(Sphere_Sphere)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& Sphere_Sphere::DynamicType() const
{
return STANDARD_TYPE(Sphere_Sphere) ;
}
Standard_Boolean Sphere_Sphere::IsKind(const Handle(Standard_Type)& AType) const
{
return (STANDARD_TYPE(Sphere_Sphere) == AType || Sphere_BasicShape::IsKind(AType));
}
Handle_Sphere_Sphere::~Handle_Sphere_Sphere() {}

View File

@ -1,4 +0,0 @@
#include <gp_Pnt.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Prs3d_Presentation.hxx>
#include <Sphere_Sphere.hxx>

View File

@ -1,33 +0,0 @@
#ifndef TRANSLATE_H
#define TRANSLATE_H
#include <qobject.h>
#include <AIS_InteractiveContext.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <Storage_Error.hxx>
#include <TCollection_AsciiString.hxx>
#include "MgtBRep_TriangleMode.hxx"
#include <STEPControl_StepModelType.hxx>
class Translate: public QObject
{
Q_OBJECT
public:
Translate(QObject* parent);
~Translate();
void importBREP( const Handle(AIS_InteractiveContext) );
void importBREP( const Handle(AIS_InteractiveContext), const QString& );
bool importBREP( const Handle(AIS_InteractiveContext), const Standard_CString );
private :
QString selectFileName( const QString& , bool isImport ) const;
static Handle(TopTools_HSequenceOfShape)
BuildSequenceFromContext( const Handle(AIS_InteractiveContext)& );
};
#endif

View File

@ -1,105 +0,0 @@
#ifndef VIEW_H
#define VIEW_H
#include <qwidget.h>
#include <AIS_InteractiveContext.hxx>
#include <V3d_View.hxx>
#include <AIS_Trihedron.hxx>
#include "MDIWindow.h"
#include "Document.h"
#include "ViewOperations.h"
#include "ViewDlg.h"
#include "ObjectDlg.h"
#include "ShapeDlg.h"
class QRubberBand;
class View: public QWidget
{
Q_OBJECT
enum CurrentAction3d { CurAction3d_Nothing,
CurAction3d_DynamicZooming,
CurAction3d_WindowZooming,
CurAction3d_DynamicPanning,
CurAction3d_GlobalPanning,
CurAction3d_DynamicRotation,
CurAction3d_MagnifyView
};
public:
View( Handle(AIS_InteractiveContext), QWidget* parent, MDIWindow* );
~View();
void setCurrentAction();
Handle_V3d_View& getView();
void startAction( ViewOperations::Action );
signals:
void selectionChanged();
void noActiveActions();
void ViewInitialized();
public slots:
void onBackground();
void paintEvent( QPaintEvent * e);
void resizeEvent( QResizeEvent* e);
private slots:
void onImportObject();
void onEditObjectProperties();
void onCreateShape();
void onLoadBox();
void onLoadSphere();
void onLoadTorus();
void onLoadLine();
void onRemoveObject();
void onWireframeMode();
void onShadingMode();
void onDisplayTrihedron();
void onEraseTrihedron();
protected:
void mousePressEvent ( QMouseEvent* e);
void mouseReleaseEvent ( QMouseEvent* e);
void mouseMoveEvent ( QMouseEvent* e);
void init();
private:
void onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point );
void onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point );
void onLButtonUp( Qt::KeyboardModifiers nFlags, const QPoint point );
void onRButtonUp( Qt::KeyboardModifiers nFlags, const QPoint point );
void onMouseMove( Qt::MouseButtons btns, Qt::KeyboardModifiers nFlags, const QPoint point );
void DragEvent( int x, int y, int TheState );
void InputEvent( int x, int y );
void MoveEvent( int x, int y );
void MultiMoveEvent( int x, int y );
void MultiDragEvent( int x, int y, int TheState );
void MultiInputEvent( int x, int y );
void Popup();
void DrawRectangle ( int MinX, int MinY, int MaxX, int MaxY, bool Draw );
private:
MDIWindow* myMDI;
QRubberBand* myRubberBand;
ObjectDlg* myObjDlg;
ShapeDlg* myShapeDlg;
Standard_Integer myFirst;
Handle_V3d_View myView;
Handle_AIS_InteractiveContext myContext;
Handle_AIS_Trihedron myTrihedron;
CurrentAction3d myCurrentMode;
Standard_Integer myXmin;
Standard_Integer myYmin;
Standard_Integer myXmax;
Standard_Integer myYmax;
Quantity_Factor myCurZoom;
Standard_Boolean myComputedModeIsOn;
Standard_Integer myCycleCounter;
};
#endif

View File

@ -1,50 +0,0 @@
// ViewDlg.h: interface for the ViewDlg class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_VIEWDLG_H__624EA574_FAC0_11D5_A986_0001021E946C__INCLUDED_)
#define AFX_VIEWDLG_H__624EA574_FAC0_11D5_A986_0001021E946C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <qdialog.h>
#include <V3d_View.hxx>
class QCheckBox;
class ViewDlg : public QDialog
{
Q_OBJECT
public:
ViewDlg(QWidget* parent/*, Handle(V3d_View)& view*/);
virtual ~ViewDlg();
public slots:
void Update();
protected:
void showEvent ( QShowEvent* );
private slots:
void onOk();
void onCancel();
void onHelp();
void onZBuffer( bool );
void onAnimation( bool );
void onDegeneration( bool );
void onAutoApply( bool );
void onApplyAllViews( bool );
private:
Standard_Boolean myAutoApply;
Standard_Boolean myApplyAllViews;
// Handle_V3d_View myView;
QCheckBox* myAnimBox;
QCheckBox* myDegBox;
QCheckBox* myZBufferBox;
Standard_Boolean myIsAnim;
Standard_Boolean myIsDeg;
};
#endif

View File

@ -1,55 +0,0 @@
#ifndef VIEWOPERATIONS_H
#define VIEWOPERATIONS_H
#include <qobject.h>
#include <qlist.h>
#include <qaction.h>
#include <AIS_InteractiveContext.hxx>
class ViewOperations : public QObject
{
Q_OBJECT
public:
enum ViewActions { /*MagViewId, AxoViewId, PerViewId,*/ ToolWireframeId, ToolShadingId };
enum Action { ViewFitAllId, ViewFitAreaId, ViewZoomId, ViewPanId,
ViewGlobalPanId, ViewFrontId, ViewBackId,
ViewTopId, ViewBottomId, ViewLeftId, ViewRightId,ViewAxoId,
ViewRotationId, ViewResetId };
ViewOperations( QObject * parent=0 ) ;
ViewOperations( Handle(AIS_InteractiveContext) theContext, QObject * parent=0 ) ;
~ViewOperations();
QList<QAction*> getViewActions();
QList<QAction*> getToolActions();
void initActions();
int getDisplayMode();
signals:
void setCursor( const QCursor& );
private slots:
void onActionActivated();
public slots:
void onWireframe();
void onShading();
void onToolAction();
void updateToggled( bool );
void onNoActiveActions();
private:
void initCursors();
void initViewActions();
void initToolActions();
private:
Handle_AIS_InteractiveContext myContext;
QList<QAction*> myViewActions;
QList<QAction*> myToolActions;
};
#endif

View File

@ -1,23 +0,0 @@
#ifndef GLOBAL_H
#define GLOBAL_H
#include <qobject.h>
#include <qstring.h>
#if defined WNT
#ifdef _DEBUG
#include <assert.h>
#define verify(a) assert(a)
#else
#define verify(a) a
#endif
#else
#define verify(a) a;
#endif
#ifndef WNT
#define true TRUE
#define false FALSE
#endif
#endif

View File

@ -1,127 +0,0 @@
<!DOCTYPE TS>
<TS version="1.1" >
<context>
<name>Application</name>
<message>
<source>ICON_AUTO_TEST</source>
<translation>../../res/auto.png</translation>
</message>
<message>
<source>ICON_CASCADE</source>
<translation>../../res/cascade.png</translation>
</message>
<message>
<source>ICON_CLOSE</source>
<translation>../../res/close.png</translation>
</message>
<message>
<source>ICON_HELP</source>
<translation>../../res/help.png</translation>
</message>
<message>
<source>ICON_NEW</source>
<translation>../../res/new.png</translation>
</message>
<message>
<source>ICON_OPTIM</source>
<translation>../../res/optim.png</translation>
</message>
<message>
<source>ICON_STOP</source>
<translation>../../res/stop.png</translation>
</message>
<message>
<source>ICON_TILE</source>
<translation>../../res/tile.png</translation>
</message>
</context>
<context>
<name>Document</name>
<message>
<source>ICON_DOC</source>
<translation>../../res/document.png</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>ICON_SAMPLE</source>
<translation>../../res/lamp.png</translation>
</message>
</context>
<context>
<name>ViewOperations</name>
<message>
<source>ICON_CURSOR_ROTATE</source>
<translation>../../res/cursor_rotate.png</translation>
</message>
<message>
<source>ICON_CURSOR_ZOOM</source>
<translation>../../res/cursor_zoom.png</translation>
</message>
<message>
<source>ICON_TOOL_SHAD</source>
<translation>../../res/tool_shading.png</translation>
</message>
<message>
<source>ICON_TOOL_WIRE</source>
<translation>../../res/tool_wireframe.png</translation>
</message>
<message>
<source>ICON_VIEW_AXO</source>
<translation>../../res/view_axo.png</translation>
</message>
<message>
<source>ICON_VIEW_BACK</source>
<translation>../../res/view_back.png</translation>
</message>
<message>
<source>ICON_VIEW_BOTTOM</source>
<translation>../../res/view_bottom.png</translation>
</message>
<message>
<source>ICON_VIEW_FITALL</source>
<translation>../../res/view_fitall.png</translation>
</message>
<message>
<source>ICON_VIEW_FITAREA</source>
<translation>../../res/view_fitarea.png</translation>
</message>
<message>
<source>ICON_VIEW_FRONT</source>
<translation>../../res/view_front.png</translation>
</message>
<message>
<source>ICON_VIEW_GLOBALPAN</source>
<translation>../../res/view_glpan.png</translation>
</message>
<message>
<source>ICON_VIEW_LEFT</source>
<translation>../../res/view_left.png</translation>
</message>
<message>
<source>ICON_VIEW_PAN</source>
<translation>../../res/view_pan.png</translation>
</message>
<message>
<source>ICON_VIEW_RESET</source>
<translation>../../res/view_reset.png</translation>
</message>
<message>
<source>ICON_VIEW_RIGHT</source>
<translation>../../res/view_right.png</translation>
</message>
<message>
<source>ICON_VIEW_ROTATION</source>
<translation>../../res/view_rotate.png</translation>
</message>
<message>
<source>ICON_VIEW_TOP</source>
<translation>../../res/view_top.png</translation>
</message>
<message>
<source>ICON_VIEW_ZOOM</source>
<translation>../../res/view_zoom.png</translation>
</message>
</context>
</TS>

View File

@ -1,589 +0,0 @@
<!DOCTYPE TS>
<TS version="1.1" >
<context>
<name>@default</name>
<message>
<source>BTN_APPLYALLVIEWS</source>
<translation>Apply on all views</translation>
</message>
<message>
<source>BTN_AUTOAPPLY</source>
<translation>Apply immediately</translation>
</message>
<message>
<source>BTN_CANCEL</source>
<translation>Cancel</translation>
</message>
<message>
<source>BTN_DEGENERATION</source>
<translation>Enable degeneration</translation>
</message>
<message>
<source>BTN_HELP</source>
<translation>Help</translation>
</message>
<message>
<source>BTN_OK</source>
<translation>Ok</translation>
</message>
<message>
<source>BTN_ZBUFFER</source>
<translation>Enable ZBuffer</translation>
</message>
<message>
<source>INF_APP_EXPORT</source>
<translation>Export file</translation>
</message>
<message>
<source>INF_APP_IMPORT</source>
<translation>Import file</translation>
</message>
<message>
<source>INF_DATA_ERROR</source>
<translation>Incorrect Data.</translation>
</message>
<message>
<source>INF_FACET_ERROR</source>
<translation>At least one shape doesn't contain facetes.</translation>
</message>
<message>
<source>INF_NOTHING_ERROR</source>
<translation>Nothing to transfer.</translation>
</message>
<message>
<source>INF_NULL_SHAPE</source>
<translation>No objects found to be saved.</translation>
</message>
<message>
<source>INF_TRANSLATE_ERROR</source>
<translation>The translation is not done.</translation>
</message>
<message>
<source>INF_WRITING_ERROR</source>
<translation>Writing has failed.</translation>
</message>
<message>
<source>MEN_DLG_DEFERRED</source>
<translation>deferred</translation>
</message>
<message>
<source>MEN_DLG_DMODE</source>
<translation>Activate display mode</translation>
</message>
<message>
<source>MEN_DLG_IMMEDIATE</source>
<translation>immediate</translation>
</message>
<message>
<source>TIT_ERROR</source>
<translation>Error</translation>
</message>
</context>
<context>
<name>Application</name>
<message>
<source>INF_ABOUT</source>
<translation>New OpenGL functionality testings.</translation>
</message>
<message>
<source>INF_READY</source>
<translation>Ready</translation>
</message>
<message>
<source>MEN_ABOUT</source>
<translation>&amp;About</translation>
</message>
<message>
<source>MEN_CASCADE</source>
<translation>&amp;Cascade</translation>
</message>
<message>
<source>MEN_CLOSE</source>
<translation>&amp;Close</translation>
</message>
<message>
<source>MEN_EXPORT_BREP</source>
<translation>&amp;Brep ...</translation>
</message>
<message>
<source>MEN_EXPORT_STL</source>
<translation>&amp;Stl ...</translation>
</message>
<message>
<source>MEN_FILE</source>
<translation>&amp;File</translation>
</message>
<message>
<source>MEN_FILE_EXPORT</source>
<translation>&amp;Export</translation>
</message>
<message>
<source>MEN_FILE_IMPORT</source>
<translation>&amp;Import</translation>
</message>
<message>
<source>MEN_HELP</source>
<translation>&amp;Help</translation>
</message>
<message>
<source>MEN_IMPORT_BREP</source>
<translation>&amp;Brep ...</translation>
</message>
<message>
<source>MEN_IMPORT_STL</source>
<translation>Stl ...</translation>
</message>
<message>
<source>MEN_NEW</source>
<translation>&amp;New 3D Viewer</translation>
</message>
<message>
<source>MEN_OPTIM</source>
<translation>Turn on/off graphic optimization</translation>
</message>
<message>
<source>MEN_QUIT</source>
<translation>&amp;Quit</translation>
</message>
<message>
<source>MEN_STATUS_BAR</source>
<translation>&amp;Statusbar</translation>
</message>
<message>
<source>MEN_TILE</source>
<translation>&amp;Tile</translation>
</message>
<message>
<source>MEN_TOOLS</source>
<translation>&amp;Tools</translation>
</message>
<message>
<source>MEN_TOOL_BAR</source>
<translation>&amp;Toolbar</translation>
</message>
<message>
<source>MEN_VIEW</source>
<translation>&amp;View</translation>
</message>
<message>
<source>MEN_WINDOWS</source>
<translation>&amp;Window</translation>
</message>
<message>
<source>MES_DISPLAY</source>
<translation>Display</translation>
</message>
<message>
<source>MES_UPDATE</source>
<translation>Update</translation>
</message>
<message>
<source>TBR_ABOUT</source>
<translation>About</translation>
</message>
<message>
<source>TBR_AUTO_TEST</source>
<translation>Start automatic testing ...</translation>
</message>
<message>
<source>TBR_CLOSE</source>
<translation>Close</translation>
</message>
<message>
<source>TBR_EXPORT_BREP</source>
<translation>Brep ...</translation>
</message>
<message>
<source>TBR_EXPORT_STL</source>
<translation>Stl ...</translation>
</message>
<message>
<source>TBR_FILE_EXPORT</source>
<translation>Export</translation>
</message>
<message>
<source>TBR_FILE_IMPORT</source>
<translation>Import</translation>
</message>
<message>
<source>TBR_IMPORT_BREP</source>
<translation>Brep ...</translation>
</message>
<message>
<source>TBR_NEW</source>
<translation>New 3D Viewer</translation>
</message>
<message>
<source>TBR_OPTIM</source>
<translation>Turn on/off graphic optimization</translation>
</message>
<message>
<source>TBR_QUIT</source>
<translation>Quit</translation>
</message>
<message>
<source>TBR_STATUS_BAR</source>
<translation>Statusbar</translation>
</message>
<message>
<source>TBR_STOP</source>
<translation>Stop automatic testing</translation>
</message>
<message>
<source>TBR_TOOL_BAR</source>
<translation>Toolbar</translation>
</message>
<message>
<source>TIT_ABOUT</source>
<translation>About...</translation>
</message>
</context>
<context>
<name>AutoTestDlg</name>
<message>
<source>BTN_START</source>
<translation>Start</translation>
</message>
<message>
<source>DLG_AUTO_TEST</source>
<translation>Automatic performance testing</translation>
</message>
<message>
<source>LAB_ITEMS</source>
<translation>elements</translation>
</message>
<message>
<source>LAB_START</source>
<translation>Start with sphere containing</translation>
</message>
<message>
<source>LAB_STEP</source>
<translation>Step</translation>
</message>
<message>
<source>LAB_STOP</source>
<translation>Stop at</translation>
</message>
<message>
<source>MEN_BTN_TEXT</source>
<translation>Test Text Performance</translation>
</message>
</context>
<context>
<name>MDIWindow</name>
<message>
<source>LAB_SECONDS</source>
<translation>Time, sec.</translation>
</message>
<message>
<source>LAB_TRIANGLES</source>
<translation>Number of Triangles</translation>
</message>
<message>
<source>LEG_NONOPT_DISPLAY</source>
<translation>Non-optimized Display</translation>
</message>
<message>
<source>LEG_NONOPT_UPDATE</source>
<translation>Non-optimized Update</translation>
</message>
<message>
<source>LEG_OPT_DISPLAY</source>
<translation>Optimized Display</translation>
</message>
<message>
<source>LEG_OPT_UPDATE</source>
<translation>Optimized Update</translation>
</message>
<message>
<source>MEN_GRAPH_CLEAR</source>
<translation>Clear</translation>
</message>
<message>
<source>MEN_GRAPH_FIT_ALL</source>
<translation>Fit All</translation>
</message>
<message>
<source>TBR_GRAPH_CLEAR</source>
<translation>Clear</translation>
</message>
<message>
<source>TBR_GRAPH_FIT_ALL</source>
<translation>Fit All</translation>
</message>
</context>
<context>
<name>ObjectDlg</name>
<message>
<source>BTN_SHOWEDGES</source>
<translation>Show edges</translation>
</message>
<message>
<source>MEN_DLG_BBOXDEGENERATION</source>
<translation>Degenerate to bounding box</translation>
</message>
<message>
<source>MEN_DLG_DEGMODEL</source>
<translation>Degenerate model</translation>
</message>
<message>
<source>MEN_DLG_DEGRATIO</source>
<translation>Degenerate ratio</translation>
</message>
<message>
<source>MEN_DLG_EDGEDASH</source>
<translation>Dash style</translation>
</message>
<message>
<source>MEN_DLG_EDGEDOT</source>
<translation>Dot style</translation>
</message>
<message>
<source>MEN_DLG_EDGEDOTDASH</source>
<translation>DotDash style</translation>
</message>
<message>
<source>MEN_DLG_EDGESOLID</source>
<translation>Solid</translation>
</message>
<message>
<source>MEN_DLG_EDGESTYLE</source>
<translation>Edge style</translation>
</message>
<message>
<source>MEN_DLG_EDGEWIDTH</source>
<translation>Edge width</translation>
</message>
<message>
<source>MEN_DLG_MARKERDEGENERATION</source>
<translation>Degenerate to markers</translation>
</message>
<message>
<source>MEN_DLG_NODEGENERATION</source>
<translation>No degeneration</translation>
</message>
<message>
<source>MEN_DLG_TINYDEGENERATION</source>
<translation>Degenerate tiny</translation>
</message>
<message>
<source>MEN_DLG_WIREDEGENERATION</source>
<translation>Degenerate to wireframe</translation>
</message>
<message>
<source>TITLE_OBJECT_DLG</source>
<translation>Edit object properties</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>TIT_SAMPLE</source>
<translation>Visualization Performance Meter</translation>
</message>
</context>
<context>
<name>ShapeDlg</name>
<message>
<source>MEN_BTN_TEXT</source>
<translation>Display Text</translation>
</message>
<message>
<source>MEN_BTN_VCOLOR</source>
<translation>Vertex colors</translation>
</message>
<message>
<source>MEN_BTN_VNORMAL</source>
<translation>Vertex normals</translation>
</message>
<message>
<source>MEN_BTN_VTEXEL</source>
<translation>Vertex texels</translation>
</message>
<message>
<source>MEN_DLG_DEFLECTION</source>
<translation>Chordial deflection</translation>
</message>
<message>
<source>MEN_DLG_ITEMS</source>
<translation>Nb items</translation>
</message>
<message>
<source>MEN_DLG_PANES</source>
<translation>Nb panes</translation>
</message>
<message>
<source>MEN_DLG_RADIUS</source>
<translation>radius</translation>
</message>
<message>
<source>MEN_DLG_X</source>
<translation>X</translation>
</message>
<message>
<source>MEN_DLG_Y</source>
<translation>Y</translation>
</message>
<message>
<source>MEN_DLG_Z</source>
<translation>Z</translation>
</message>
<message>
<source>TITLE_SHAPE_DLG</source>
<translation>Create sphere</translation>
</message>
</context>
<context>
<name>View</name>
<message>
<source>MEN_POP_BOX</source>
<translation>Box</translation>
</message>
<message>
<source>MEN_POP_CREATESHAPE</source>
<translation>Create shape ...</translation>
</message>
<message>
<source>MEN_POP_DISPLAYMODE</source>
<translation>Display mode</translation>
</message>
<message>
<source>MEN_POP_DISPLAYTRIHEDRON</source>
<translation>Display trihedron</translation>
</message>
<message>
<source>MEN_POP_ERASETRIHEDRON</source>
<translation>Erase trihedron</translation>
</message>
<message>
<source>MEN_POP_IMPORT</source>
<translation>Import object ...</translation>
</message>
<message>
<source>MEN_POP_LINE</source>
<translation>Line</translation>
</message>
<message>
<source>MEN_POP_LOADOBJECT</source>
<translation>Load object</translation>
</message>
<message>
<source>MEN_POP_OBJPROP</source>
<translation>Edit object properties ...</translation>
</message>
<message>
<source>MEN_POP_REMOVEOBJECT</source>
<translation>Remove object</translation>
</message>
<message>
<source>MEN_POP_SHADING</source>
<translation>Shading</translation>
</message>
<message>
<source>MEN_POP_SPHERE</source>
<translation>Sphere</translation>
</message>
<message>
<source>MEN_POP_TORUS</source>
<translation>Torus</translation>
</message>
<message>
<source>MEN_POP_VIEWPROP</source>
<translation>Edit view properties ...</translation>
</message>
<message>
<source>MEN_POP_WIREFRAME</source>
<translation>Wireframe</translation>
</message>
</context>
<context>
<name>ViewDlg</name>
<message>
<source>BTN_ANIMATION</source>
<translation>Enable view animation</translation>
</message>
<message>
<source>TITLE_VIEW_DLG</source>
<translation>Edit view properties</translation>
</message>
</context>
<context>
<name>ViewOperations</name>
<message>
<source>TBR_AXO</source>
<translation>Axo</translation>
</message>
<message>
<source>TBR_BACK</source>
<translation>Back</translation>
</message>
<message>
<source>TBR_BOTTOM</source>
<translation>Bottom</translation>
</message>
<message>
<source>TBR_FITALL</source>
<translation>FitAll</translation>
</message>
<message>
<source>TBR_FITAREA</source>
<translation>Zoom Window</translation>
</message>
<message>
<source>TBR_FRONT</source>
<translation>Front</translation>
</message>
<message>
<source>TBR_GLOBALPAN</source>
<translation>Global Panning</translation>
</message>
<message>
<source>TBR_LEFT</source>
<translation>Left</translation>
</message>
<message>
<source>TBR_PAN</source>
<translation>Dynamic Panning</translation>
</message>
<message>
<source>TBR_RESET</source>
<translation>Reset</translation>
</message>
<message>
<source>TBR_RIGHT</source>
<translation>Right</translation>
</message>
<message>
<source>TBR_ROTATION</source>
<translation>Dynamic Rotation</translation>
</message>
<message>
<source>TBR_TOOL_AXOVIEW</source>
<translation>Axonometric view</translation>
</message>
<message>
<source>TBR_TOOL_MAGVIEW</source>
<translation>Magnify view</translation>
</message>
<message>
<source>TBR_TOOL_PERVIEW</source>
<translation>Perspective view</translation>
</message>
<message>
<source>TBR_TOOL_SHAD</source>
<translation>Shading</translation>
</message>
<message>
<source>TBR_TOOL_WIRE</source>
<translation>Wireframe</translation>
</message>
<message>
<source>TBR_TOP</source>
<translation>Top</translation>
</message>
<message>
<source>TBR_ZOOM</source>
<translation>Dynamic Zooming</translation>
</message>
</context>
</TS>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

View File

@ -1,695 +0,0 @@
#include <stdio.h>
#include <AIS_InteractiveContext.hxx>
#include <OSD_Timer.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_Shape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Face.hxx>
#include <Poly_Triangulation.hxx>
#include <BRep_TFace.hxx>
#include <TopoDS.hxx>
#include <Sphere_Sphere.hxx>
#include <AIS_Trihedron.hxx>
#include <qapplication.h>
#include <qframe.h>
#include <qworkspace.h>
#include <qstatusbar.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qtextedit.h>
#include <qlayout.h>
#include <qevent.h>
#include "global.h"
#include "Application.h"
#include "Document.h"
#include "MDIWindow.h"
#include "Translate.h"
#include "ViewOperations.h" // to have access to its enumeration
#include "AutoTestDlg.h"
//#define OUTPUT_WINDOW
static Application* stApp;
static OSD_Timer timer;
Application::Application() : QMainWindow( 0 )
{
myNbDocuments = 0;
stApp = this;
myIsDocuments = false;
// create and define the central widget
QFrame* vBox = new QFrame( this );
vBox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
QVBoxLayout* main = new QVBoxLayout( vBox );
main->setMargin( 0 );
myWorkSpace = new QWorkspace( vBox );
main->addWidget( myWorkSpace );
setCentralWidget( vBox );
createActions();
createCCActions();
statusBar()->showMessage( tr("INF_READY"), 2001 );
resize( 800, 650 );
verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ),
this, SLOT( onWindowActivated( QWidget* ) ) ) );
#ifdef OUTPUT_WINDOW
myOutput = new OutputWindow( 0 );
myOutput->show();
#else
myOutput = 0;
#endif
myViewDlg = NULL;
}
Application::~Application()
{
if (myViewDlg) delete myViewDlg;
if (myOutput) delete myOutput;
}
void Application::createActions()
{
QString dir = getResourceDir();
QPixmap newIcon( dir + tr( "ICON_NEW" ) ),
helpIcon( dir + tr( "ICON_HELP" ) ),
closeIcon( dir + tr( "ICON_CLOSE" ) ),
autoIcon( dir + tr( "ICON_AUTO_TEST" ) ),
optimIcon( dir + tr( "ICON_OPTIM" ) ),
stopIcon( dir + tr( "ICON_STOP" ) ),
tileIcon( dir + tr( "ICON_TILE" ) ),
cascadeIcon( dir + tr( "ICON_CASCADE" ) );
// toolbar with standard actions: new, save...
myStdToolBar = new QToolBar( this );
addToolBar( Qt::TopToolBarArea, myStdToolBar );
// menu with all actions
myFilePopup = menuBar()->addMenu( tr( "MEN_FILE" ) );
// view menu
QMenu* view = menuBar()->addMenu( tr( "MEN_VIEW" ) );
// Tools menu (it is shown or hidden dynamically)
myToolsMenu = new QMenu( tr( "MEN_TOOLS" ), this );
// Window menu
myWinMenu = menuBar()->addMenu( tr( "MEN_WINDOWS" ) );
verify(connect( myWinMenu, SIGNAL( aboutToShow() ),
this, SLOT( updateWindowList() ) ));
// add a help menu
QMenu* help = menuBar()->addMenu( tr( "MEN_HELP" ) );
menuBar()->addSeparator();
QAction* a = new QAction( newIcon, tr( "MEN_NEW" ), this );
a->setToolTip( tr( "TBR_NEW" ) );
a->setShortcut( Qt::CTRL+Qt::Key_N );
verify( connect( a, SIGNAL( activated() ), this, SLOT( onNewDocument() ) ) );
myStdActions.insert( FileNewId, a );
myStdToolBar->addAction( a );
myFilePopup ->addAction( a );
a = new QAction( tr( "MEN_QUIT" ), this );
a->setShortcut( Qt::CTRL+Qt::Key_Q );
a->setToolTip( tr( "TBR_QUIT" ) );
verify( connect( a, SIGNAL( activated() ), qApp, SLOT( closeAllWindows() ) ) );
myStdActions.insert( FileQuitId, a );
myFilePopup ->addAction( a );
a = new QAction( tr( "MEN_TOOL_BAR" ), this );
a->setToolTip( tr( "TBR_TOOL_BAR" ) );
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewToolBar() ) ) );
a->setCheckable(true);
a->setChecked( true );
myStdActions.insert( ViewToolId, a );
view->addAction( a );
a = new QAction( tr("MEN_STATUS_BAR"), this );
a->setToolTip( tr( "TBR_STATUS_BAR" ) );
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewStatusBar() ) ) );
a->setCheckable(true);
a->setChecked( true );
myStdActions.insert( ViewStatusId, a );
view->addAction( a );
a = new QAction( helpIcon, tr( "MEN_ABOUT" ), this );
a->setShortcut( Qt::Key_F1 );
a->setToolTip( tr( "TBR_ABOUT" ) );
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAbout() ) ) );
myStdActions.insert( HelpAboutId, a );
myStdToolBar->addAction( a );
help->addAction( a );
myStdToolBar->addSeparator();
// Tools menu actions
a = new QAction( optimIcon, tr( "MEN_OPTIM" ), this );
a->setToolTip( tr( "TBR_OPTIM" ) );
verify( connect( a, SIGNAL( toggled(bool) ) , this, SLOT( onToggleOptim(bool) ) ) );
a->setCheckable(true);
a->setChecked(Graphic3d_ArrayOfPrimitives::IsEnable());
myStdActions.insert( OptimId, a );
myToolsMenu->addAction( a );
a = new QAction( autoIcon, tr( "TBR_AUTO_TEST" ), this );
a->setToolTip( tr( "TBR_AUTO_TEST" ) );
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAutoTest() ) ) );
myStdActions.insert( AutoTestId, a );
myToolsMenu->addAction( a );
a = new QAction( stopIcon, tr( "TBR_STOP" ), this );
a->setToolTip( tr( "TBR_STOP" ) );
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onStop() ) ) );
myStdActions.insert( StopId, a );
myToolsMenu->addAction( a );
// Window menu action
a = new QAction( cascadeIcon, tr( "MEN_CASCADE" ), this );
verify( connect( a, SIGNAL( activated() ) , myWorkSpace, SLOT( cascade() ) ) );
myStdActions.insert( CascadeId, a );
myWinMenu->addAction( a );
a = new QAction( tileIcon, tr( "MEN_TILE" ), this );
verify( connect( a, SIGNAL( activated() ), myWorkSpace, SLOT( tile() ) ) );
myStdActions.insert( TileId, a );
myWinMenu->addAction( a );
}
void Application::createCCActions()
{
createIEPopups();
}
void Application::createIEPopups()
{
myImportPopup = new QMenu( tr( "MEN_FILE_IMPORT" ), this );
QAction* a = new QAction( tr( "MEN_IMPORT_BREP" ), this );
a->setToolTip( tr( "TBR_IMPORT_BREP" ) );
verify( connect( a, SIGNAL( activated() ) , SLOT( onTranslate() ) ) );
myCCActions.insert( FileImportBREPId, a );
myImportPopup->addAction( a );
}
QWorkspace* Application::getWorkspace()
{
return getApplication()->workspace();
}
Application* Application::getApplication()
{
return stApp;
}
void Application::updateWindowList()
{
while ( myWinMenu->actions().count() > 2)
myWinMenu->removeAction(myWinMenu->actions().last());
QWidgetList lst = myWorkSpace->windowList();
if (!lst.isEmpty())
{
myWinMenu->addSeparator();
for ( int i = 0; i < int(lst.count()); ++i )
{
QAction* a = myWinMenu->addAction( lst.at(i)->windowTitle(),
this, SLOT( activateWindow() ) );
a->setCheckable( true );
a->setChecked( myWorkSpace->activeWindow() == lst.at(i) );
}
}
}
void Application::activateWindow()
{
QAction* a = qobject_cast<QAction*>( sender() );
if ( !a ) return;
int idx = myWinMenu->actions().indexOf( a ) - 3; // tile, cascade and separator
QWidget* w = myWorkSpace->windowList().at( idx );
if ( w ) {
w->showNormal();
w->setFocus();
// w->setActiveWindow();
}
}
void Application::updateActions()
{
int count = myFilePopup->actions().count() - 1;
int popupCount = menuBar()->actions().count();
while (myWinMenu->actions().count() > 2)
myWinMenu->removeAction(myWinMenu->actions().last());
if( myWorkSpace->windowList().isEmpty() )
{
QAction* optim = myStdActions.at(OptimId);
QAction* autoTest = myStdActions.at(AutoTestId);
QAction* stop = myStdActions.at(StopId);
if( myNbDocuments ) {
myFilePopup->insertMenu( myFilePopup->actions().last(), myImportPopup );
myFilePopup->insertSeparator( myFilePopup->actions().last() );
menuBar()->insertMenu( menuBar()->actions().at( popupCount - 3 ), myToolsMenu );
if (optim) myStdToolBar->addAction( optim );
if (autoTest) myStdToolBar->addAction( autoTest );
if (stop) myStdToolBar->addAction( stop );
stop->setEnabled(false);
myIsDocuments = true;
}
else {
myFilePopup->actions().removeAt( --count );
myFilePopup->actions().removeAt( --count );
myFilePopup->actions().removeAt( --count );
menuBar()->actions().removeAt( popupCount - 4 );
if (optim) myStdToolBar->removeAction( optim );
if (autoTest) myStdToolBar->removeAction( autoTest );
if (stop) myStdToolBar->removeAction( stop );
myIsDocuments = false;
}
}
}
Document* Application::onNewDocument()
{
++myNbDocuments;
updateActions();
Document* aDoc = new Document( myNbDocuments, this );
verify( connect( aDoc, SIGNAL( sendCloseDocument( Document* ) ),
SLOT( onCloseDocument( Document* ) ) ) );
return aDoc;
}
void Application::onCloseDocument(Document* theDoc)
{
--myNbDocuments;
delete theDoc;
updateActions();
}
void Application::onTranslate()
{
const QObject* sentBy = sender();
typedef void (Translate::*LPFN_IMPORT)
( const Handle( AIS_InteractiveContext ));//, const QString& );
static LPFN_IMPORT lpfnImport[] = { &Translate::importBREP };
static QAction* actions[] = { myCCActions.at( FileImportBREPId ) };
for ( int i = 0; i < sizeof(actions)/sizeof(QAction*); i++ )
{
if ( actions[i] == sentBy )
{
Translate* anTrans = new Translate( 0 );
MDIWindow* win = myActiveMDI;//(MDIWindow*) myWorkSpace->activeWindow();
Handle(AIS_InteractiveContext) aContext = win->getDocument()->getContext();
try
{
/* import */
(anTrans->*lpfnImport[i])( aContext );
}
catch ( Standard_Failure )
{
/* WARNING: an exception raised but we eat it
silently because the shape seems OK
*/
}
delete anTrans;
/* commit transaction */
win->activateAction( ViewOperations::ViewFitAllId );
break;
}
}
}
void Application::importBREP()
{
Translate* anTrans = new Translate( 0 );
MDIWindow* win = myActiveMDI;//(MDIWindow*) myWorkSpace->activeWindow();
Handle(AIS_InteractiveContext) aContext = win->getDocument()->getContext();
try {
/* import */
anTrans->importBREP( aContext );
}
catch ( Standard_Failure ) {
/* WARNING: an exception raised but we eat it
silently because the shape seems OK
*/
}
delete anTrans;
win->activateAction( ViewOperations::ViewFitAllId );
}
QString Application::getResourceDir()
{
static QString resDir( getenv( "CSF_ResourcesDefaults" ) + QString( "/" ) );
return resDir;
}
void Application::onViewToolBar()
{
bool show = myStdActions.at( ViewToolId )->isChecked();
if ( show == myStdToolBar->isVisible() )
return;
if ( show )
myStdToolBar->show();
else
myStdToolBar->hide();
}
void Application::onViewStatusBar()
{
bool show = myStdActions.at( ViewStatusId )->isChecked();
if ( show == statusBar()->isVisible() )
return;
if ( show )
statusBar()->show();
else
statusBar()->hide();
}
void Application::onAbout()
{
QMessageBox::information(this,tr("TIT_ABOUT"),tr("INF_ABOUT"), tr("BTN_OK"),
QString::null, QString::null, 0, 0);
}
void Application::onQuit()
{
#ifdef aaa
QWidgetList aList = stWs->windowList();
for(MDIWindow* aWindow = (MDIWindow*) aList.first();aWindow;aWindow = (MDIWindow*) aList.next()) {
aWindow->closeEvent(0);
}
emit sendQuit();
#endif
}
MDIWindow* Application::getActiveMDI()
{
return myActiveMDI;
}
void Application::onWindowActivated( QWidget* w )
{
if ( w != NULL && w->inherits( "MDIWindow" ) ){
myActiveMDI = (MDIWindow*)w;
w->setFocus();
}
else if (myViewDlg)
{
delete myViewDlg; myViewDlg = NULL;
}
}
void Application::startTimer()
{
timer.Reset();
timer.Start();
}
void Application::stopTimer( int count, const char* mes, bool addToGraph, int aOpt )
{
Standard_Integer m,h;
Standard_Real fps,elaps,cpu;
char title[256];
const char* message = ( mes == NULL ) ? "" : mes;
timer.Stop();
timer.Show( elaps, m, h, cpu );
elaps += m * 60. + h * 3600.;
fps = Standard_Real( count ) / elaps;
if( fps > 1. )
sprintf( title, " ====> '%s'. speed is %f frames/second", message, fps );
else {
if( count > 1 ) {
elaps /= count; cpu /= count;
sprintf( title, " ====> '%s'. average elapsed/cpu time is %f/%f seconds", message, elaps, cpu );
}
else {
sprintf( title," ====> '%s'. elapsed/cpu time is %f/%f seconds.", message, elaps, cpu );
}
}
if (addToGraph)
{
QString qmes(mes);
MDIWindow::ResultType type = MDIWindow::Undefined;
bool isOptOn = false;
if(aOpt >= 0) {
isOptOn |= (aOpt > 0);
} else {
isOptOn = Graphic3d_ArrayOfPrimitives::IsEnable();
}
if (qmes.contains(tr("MES_DISPLAY"), Qt::CaseInsensitive))
type = isOptOn ? MDIWindow::DisplayOpt : MDIWindow::DisplayNonOpt;
else if (qmes.contains(tr("MES_UPDATE"), Qt::CaseInsensitive))
type = isOptOn ? MDIWindow::UpdateOpt : MDIWindow::UpdateNonOpt;
if (type != MDIWindow::Undefined)
{
addResult(type, elaps);
}
}
QString str( title );
cout << title << endl;
Application::getApplication()->statusBar()->showMessage( str );
Application::getApplication()->showMessage( str );
//printf("%s\n",title);
}
void Application::showTimer( const char* mes )
{
Standard_Integer m,h;
Standard_Real elaps,cpu;
char title[256];
const char* message = ( mes == NULL) ? "" : mes;
timer.Show( elaps, m, h, cpu );
elaps += m * 60. + h * 3600.;
sprintf( title," ====> '%s'. elapsed/cpu time is %f/%f seconds", message, elaps, cpu );
QString str( title );
Application::getApplication()->statusBar()->showMessage( str );
Application::getApplication()->showMessage( str );
cout << title << endl;
}
void Application::showMessage( QString& message )
{
#ifdef OUTPUT_WINDOW
myOutput->print( message );
#endif
}
void Application::onToggleOptim(bool state)
{
state ? Graphic3d_ArrayOfPrimitives::Enable() : Graphic3d_ArrayOfPrimitives::Disable();
}
void Application::addResult(MDIWindow::ResultType item, double value)
{
MDIWindow* activeWin = getApplication()->getActiveMDI();
Handle(AIS_InteractiveContext) activeCtx = activeWin->getDocument()->getContext();
// Counting triangles...
int nbTriangles = 0;
AIS_ListOfInteractive displayedObjs;
activeCtx->DisplayedObjects(displayedObjs);
AIS_ListIteratorOfListOfInteractive dispIt(displayedObjs);
for ( ; dispIt.More(); dispIt.Next())
{
Handle(AIS_InteractiveObject) aisObj = dispIt.Value();
if (aisObj->IsKind(STANDARD_TYPE(Sphere_Sphere)))
{
Handle(Sphere_Sphere) sphere = Handle(Sphere_Sphere)::DownCast(aisObj);
Standard_Real rad = sphere->Radius();
Standard_Real defl = sphere->Sphere_BasicShape::Deflection();
nbTriangles += Sphere_Sphere::NbItems(Sphere_Sphere::NbPanes(rad, defl));
}
else if (aisObj->IsKind(STANDARD_TYPE(AIS_Shape)))
{
Handle(AIS_Shape) shape = Handle(AIS_Shape)::DownCast(aisObj);
TopoDS_Shape topoShape = shape->Shape();
TopExp_Explorer exp(topoShape, TopAbs_FACE);
for ( ; exp.More(); exp.Next())
{
TopoDS_Face face = TopoDS::Face(exp.Current());
if (!face.IsNull())
{
Handle(Poly_Triangulation) triangles =
Handle(BRep_TFace)::DownCast(face.TShape())->Triangulation();
if (!triangles.IsNull())
{
nbTriangles += triangles->NbTriangles();
}
}
}
}
}
activeWin->addResult(item, nbTriangles, value);
}
QWorkspace* Application::workspace() const
{
return myWorkSpace;
}
void Application::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape)
myEscPressed = true;
}
void Application::onAutoTest()
{
AutoTestDlg autoDlg(getApplication());
if (autoDlg.exec() == QDialog::Accepted)
{
QApplication::setOverrideCursor( Qt::WaitCursor );
myEscPressed = false;
myStopPressed = false;
QAction* stop = myStdActions.at(StopId);
stop->setEnabled(true);
// Define the range for testing
int startItems = autoDlg.getStartNbItems();
int stopItems = autoDlg.getStopNbItems();
int step = autoDlg.getStep();
bool isTe = autoDlg.isText();
if (stopItems < startItems) stopItems = startItems;
Standard_Real radius = 100; // default sphere radius
gp_Pnt pos(0, 0, 0); // default sphere center position
Handle(AIS_InteractiveContext) ctx = getActiveMDI()->getDocument()->getContext();
// Main loop
for (int currItems = startItems; currItems <= stopItems; currItems += step)
{
for (int useOptim = 0; useOptim < 2; useOptim++)
{
qApp->processEvents();
if (myEscPressed || myStopPressed)
{
QApplication::restoreOverrideCursor();
stop->setEnabled(false);
return;
}
// Toggle optimization
useOptim || isTe ? Graphic3d_ArrayOfPrimitives::Enable() : Graphic3d_ArrayOfPrimitives::Disable();
// Remove all old objects
AIS_ListOfInteractive displayedObjs;
ctx->DisplayedObjects(displayedObjs);
AIS_ListIteratorOfListOfInteractive dispIt(displayedObjs);
for ( ; dispIt.More(); dispIt.Next())
{
Handle(AIS_InteractiveObject) obj = dispIt.Value();
if (!obj->IsKind(STANDARD_TYPE(AIS_Trihedron)))
ctx->Remove(obj, false);
}
ctx->UpdateCurrentViewer();
getActiveMDI()->getView()->SetScale(3.0316);
// Generate new sphere
Standard_Integer nbPanes = Sphere_Sphere::NbPanes(currItems);
Standard_Real deflection = Sphere_Sphere::Deflection(radius, nbPanes);
Handle(Sphere_Sphere) sphere = new Sphere_Sphere(pos, radius, deflection,
1/*myVNormalsFlag*/, 0/*myVColorsFlag*/, 0/*myVTexelsFlag*/, isTe, useOptim);
// Display the sphere
ctx->SetDisplayMode( sphere, getActiveMDI()->getDisplayMode(), false );
Application::startTimer();
ctx->Display( sphere, false );
Application::stopTimer( 0, "Display Sphere::Sphere", true, useOptim);
qApp->processEvents();
if (myEscPressed || myStopPressed)
{
QApplication::restoreOverrideCursor();
stop->setEnabled(false);
return;
}
// Update the viewer
Application::startTimer();
getActiveMDI()->getView()->Update();
Application::stopTimer( 0, "UPDATE", true, useOptim);
}
}
QApplication::restoreOverrideCursor();
stop->setEnabled(false);
}
}
/* ------------------ class OutputWindow ----------------- */
OutputWindow::OutputWindow( QWidget* parent ) : QWidget( parent ), myLineCounter( 0 )
{
setWindowTitle( "Output window" );
resize( 400, 300 );
QVBoxLayout* topLayout = new QVBoxLayout( this );
myLineEdit = new QTextEdit( this );
topLayout->addWidget( myLineEdit );
}
OutputWindow::~OutputWindow()
{
}
void OutputWindow::print( QString& s )
{
myLineEdit->append( QString().setNum( myLineCounter ) + s );
myLineCounter++;
}
void Application::InitApp()
{
onNewDocument();
}
void Application::onStop()
{
myStopPressed = true;
}
void Application::onEditViewProperties()
{
if ( !myViewDlg ) {
myViewDlg = new ViewDlg(this);
verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ),
myViewDlg, SLOT( Update() ) ) );
}
myViewDlg->raise();
myViewDlg->show();
}
void Application::updateViewDlg()
{
if(myViewDlg) myViewDlg->Update();
}

View File

@ -1,169 +0,0 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include "Application.h"
#include "AutoTestDlg.h"
#include "global.h"
AutoTestDlg::AutoTestDlg(QWidget* parent)
: QDialog(parent)
{
setModal( true );
setWindowTitle(tr("DLG_AUTO_TEST"));
QString dir = Application::getResourceDir();
QPixmap autoIcon( dir + tr( "ICON_AUTO_TEST" ) );
setWindowIcon(autoIcon);
QGridLayout* pMainLayout = new QGridLayout(this);
pMainLayout->setMargin(5);
pMainLayout->setSpacing(5);
QLabel* lab = new QLabel(tr("LAB_START"), this);
pMainLayout->addWidget(lab, 0, 0);
lab = new QLabel(tr("LAB_STOP"), this);
pMainLayout->addWidget(lab, 1, 0);
lab = new QLabel(tr("LAB_STEP"), this);
pMainLayout->addWidget(lab, 2, 0);
const int MinNbOfItems = 100000; // to see noticable effect
const int MaxNbOfItems = 1000000; // to avoid too long computations
const int ItemsStep = 100000;
const int MinStep = 50000;
const int StepStep = 50000;
myStartSpin = new QSpinBox(this);
myStartSpin->setMinimum(MinNbOfItems);
myStartSpin->setMaximum(MaxNbOfItems);
myStartSpin->setSingleStep(ItemsStep);
pMainLayout->addWidget(myStartSpin, 0, 1);
verify(connect(myStartSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
myStopSpin = new QSpinBox(this);
myStopSpin->setMinimum(MinNbOfItems);
myStopSpin->setMaximum(MaxNbOfItems);
myStartSpin->setSingleStep(ItemsStep);
pMainLayout->addWidget(myStopSpin, 1, 1);
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(setStartMaxValue(int))));
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
const int StopSpinDefaultValue = 2 * myStartSpin -> minimum();
myStopSpin -> setValue(StopSpinDefaultValue);
myStartSpin -> setMaximum(myStopSpin -> value());
myStepSpin = new QSpinBox(this);
myStepSpin->setMinimum(MinStep);
myStepSpin->setMaximum(MaxNbOfItems - MinNbOfItems);
myStepSpin->setSingleStep(StepStep);
pMainLayout->addWidget(myStepSpin, 2, 1);
lab = new QLabel(tr("LAB_ITEMS"), this);
pMainLayout->addWidget(lab, 0, 2);
lab = new QLabel(tr("LAB_ITEMS"), this);
pMainLayout->addWidget(lab, 1, 2);
lab = new QLabel(tr("LAB_ITEMS"), this);
pMainLayout->addWidget(lab, 2, 2);
QFrame* separator = new QFrame(this);
separator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
pMainLayout->addWidget(separator, 3, 0, 1, 3 );
QHBoxLayout* hcbox = new QHBoxLayout();
hcbox->setSpacing(5);
myTeCheck = new QCheckBox(tr( "MEN_BTN_TEXT" ), this);
hcbox->addWidget(myTeCheck);
verify(connect(myTeCheck, SIGNAL(clicked()), this, SLOT(onText())));
hcbox->addSpacing( 5 );
pMainLayout->addLayout(hcbox, 4, 0, 1, 3);
QHBoxLayout* hbox = new QHBoxLayout();
hbox->setSpacing(5);
QPushButton* btn = new QPushButton(tr("BTN_START"), this);
// btn->setDefault(true);
verify(connect(btn, SIGNAL(clicked()), this, SLOT(onStart())));
btn->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
hbox->addWidget(btn);
btn = new QPushButton(tr("BTN_CANCEL"), this);
verify(connect(btn, SIGNAL(clicked()), this, SLOT(onCancel())));
btn->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
hbox->addWidget(btn);
hbox->addSpacing(5);
pMainLayout->addLayout(hbox, 5, 0, 1, 3);
}
void AutoTestDlg::onStart()
{
accept();
}
void AutoTestDlg::onCancel()
{
reject();
}
void AutoTestDlg::setStartMaxValue(int i)
{
myStartSpin -> setMaximum(i);
if (myStartSpin -> value() > myStartSpin -> maximum())
myStartSpin -> setValue(myStartSpin -> maximum());
}
void AutoTestDlg::checkStepSpinState()
{
if (isVisible())
{
if (myStartSpin -> value() == myStopSpin -> value())
myStepSpin -> setEnabled(false);
else
myStepSpin -> setEnabled(true);
}
}
void AutoTestDlg::onText()
{
int MinNbOfItems, MaxNbOfItems, DefaultStartSpinVal, DefaultStopSpinVal,
ItemsStep, MinStep, StepStep;
if (myTeCheck -> isChecked())
{
MinNbOfItems = 1000; // to see noticeable effect
MaxNbOfItems = 100000; // to avoid too long computations
DefaultStartSpinVal = 10000;
DefaultStopSpinVal = 20000;
ItemsStep = 10000;
MinStep = 5000;
StepStep = 5000;
}
else
{
MinNbOfItems = 100000; // to see noticeable effect
MaxNbOfItems = 1000000; // to avoid too long computations
DefaultStartSpinVal = 100000;
DefaultStopSpinVal = 200000;
ItemsStep = 100000;
MinStep = 50000;
StepStep = 50000;
}
myStartSpin -> setRange(MinNbOfItems, MaxNbOfItems);
myStartSpin -> setSingleStep(ItemsStep);
myStartSpin -> setValue(DefaultStartSpinVal);
myStopSpin -> setRange(MinNbOfItems, MaxNbOfItems);
myStopSpin -> setSingleStep(ItemsStep);
myStopSpin -> setValue(DefaultStopSpinVal);
myStartSpin -> setMaximum(myStopSpin -> value());
myStepSpin -> setRange(MinStep, MaxNbOfItems - MinNbOfItems);
myStepSpin -> setSingleStep(StepStep);
myStepSpin -> setValue(MinStep);
}

View File

@ -1,147 +0,0 @@
#include <qstatusbar.h>
#ifndef WNT
#include <Graphic3d_GraphicDevice.hxx>
#else
#include <Graphic3d_WNTGraphicDevice.hxx>
#endif
#include <V3d_View.hxx>
#include "Application.h"
#include "Document.h"
#include "global.h"
Handle(V3d_Viewer) Document::Viewer( const Standard_CString aDisplay,
const Standard_ExtString aName,
const Standard_CString aDomain,
const Standard_Real ViewSize )
{
#ifndef WNT
static Handle(Graphic3d_GraphicDevice) defaultdevice;
if ( defaultdevice.IsNull() )
defaultdevice = new Graphic3d_GraphicDevice( aDisplay );
return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize,
V3d_XposYnegZpos,Quantity_NOC_MIDNIGHTBLUE,
V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT);
#else
static Handle(Graphic3d_WNTGraphicDevice) defaultdevice;
if ( defaultdevice.IsNull() )
defaultdevice = new Graphic3d_WNTGraphicDevice();
return new V3d_Viewer( defaultdevice, aName, aDomain, ViewSize,
V3d_XposYnegZpos,Quantity_NOC_MIDNIGHTBLUE,
V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT);
#endif // WNT
}
Document::Document( int theIndex, Application* app )
: QObject( app )
{
myIndex = theIndex;
myNbViews = 0;
myApp = app;
TCollection_ExtendedString a3DName("Visual3D");
myViewer = Viewer( getenv( "DISPLAY" ), a3DName.ToExtString(), "", 1000.0 );
myViewer->SetDefaultLights();
myViewer->SetLightOn();
myViewer->SetZBufferManagment(false);
myContext = new AIS_InteractiveContext( myViewer );
createNewView();
myOperations = new ViewOperations( myContext );
}
Document::~Document()
{
qDeleteAll( myViews );
}
Application* Document::getApplication()
{
return myApp;
}
void Document::createNewView( V3d_TypeOfView type )
{
QWorkspace* ws = myApp->getWorkspace();
MDIWindow* w = new MDIWindow( this, ws, type );
myViews.append( w );
ws->addWindow( w );
//connect( w, SIGNAL( message(const QString&, int) ), myApp->statusBar(), SLOT( message(const QString&, int )) );
verify( connect( w, SIGNAL( sendCloseView( MDIWindow* ) ),
SLOT( onCloseView( MDIWindow* ) ) ) );
QString aName;
w->setWindowTitle( aName.sprintf( "3D Viewer_%d:%d", myIndex, ++myNbViews ) );
QString dir = Application::getResourceDir();
w->setWindowIcon( QPixmap( dir + tr( "ICON_DOC" ) ) );
// show the very first window in maximized mode
if ( ws->windowList().isEmpty() )
w->showMaximized();
else
w->show();
}
void Document::createMagView( int xMin, int yMin, int xMax, int yMax )
{
#ifdef old
Handle(V3d_View) currentView =
( (MDIWindow*) myApp->getWorkspace()->activeWindow() )->getView();
createNewView( false );
MDIWindow* newView = myViews.last();
Handle(V3d_View) nView = newView->getView();
newView->show();
nView->FitAll();
//nView->ZFitAll();
//nView->Redraw();
//nView->WindowFitAll( xMin, yMin, xMax, yMax );
nView->SetMagnify( currentView->Window(), currentView, 10, 10, 100, 100 );
//nView->SetMagnify( nView->Window(), currentView, xMin, yMin, xMax, yMax );
#endif
}
void Document::onCloseView(MDIWindow* theView)
{
if ( countOfWindow() == 1 )
emit sendCloseDocument( this );
else
removeView( theView );
}
void Document::removeView(MDIWindow* theView)
{
myViews.removeAll( theView );
//delete theView;
}
int Document::countOfWindow()
{
return myViews.count();
}
Handle(AIS_InteractiveContext)& Document::getContext()
{
return myContext;
}
void Document::onWireframe()
{
myOperations->onWireframe();
}
void Document::onShading()
{
myOperations->onShading();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
#include <stdlib.h>
#include <qmainwindow.h>
#include <qapplication.h>
#include <qtranslator.h>
#include <qpixmap.h>
#include <qtranslator.h>
#include "global.h"
#include "Application.h"
#define GLOBAL_CONTEXT "@default"
class Translator : public QTranslator
{
public:
Translator( QObject* parent = 0 ) : QTranslator( parent ) {}
virtual QString translate( const char* context,
const char* sourceText,
const char* comment = 0 ) const
{
QString res = QTranslator::translate( context, sourceText, comment );
if( res.isNull() )
res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
return res;
}
};
int main(int argc, char* argv[])
{
QApplication a( argc, argv );
QString dir( getenv( "CSF_ResourcesDefaults" ) );
Translator msg( 0 ), img( 0 );
msg.load( "Sample_msg.qm", dir );
a.installTranslator( &msg );
img.load( "Sample_icons.qm", dir );
a.installTranslator( &img );
QPixmap pix( dir + QString( "/" ) + QObject::tr( "ICON_SAMPLE" ) );
Application* app = new Application();
app->setWindowTitle( QObject::tr( "TIT_SAMPLE" ) );
app->setWindowIcon( pix );
QApplication::setOverrideCursor( Qt::WaitCursor );
app->show();
app->InitApp();
QApplication::restoreOverrideCursor();
return a.exec();
}

View File

@ -1,206 +0,0 @@
#include <qlayout.h>
#include <qframe.h>
#include <qtoolbar.h>
#include <qfiledialog.h>
#include <qapplication.h>
#include <qmessagebox.h>
#include <qaction.h>
#include <qsplitter.h>
#include <qmenu.h>
#include <qevent.h>
#include "MDIWindow.h"
#include "global.h"
#include "Document.h"
#include "View.h"
#include "ViewOperations.h"
#include "Graph.h"
#include "Application.h"
MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type )
: QMainWindow( parent )
{
resize( 500, 300 );
QSplitter* central = new QSplitter(Qt::Vertical, this);
myDocument = aDocument;
Handle(AIS_InteractiveContext) cxt = myDocument->getContext();
cxt->CurrentViewer()->SetDefaultTypeOfView( type );
myView = new View( cxt, central, this );
verify(connect(myView, SIGNAL(ViewInitialized()),
Application::getApplication(), SLOT(updateViewDlg())));
// Graph initialization
myGraphView = new GraphSplitView(central);
GraphView* pGraph = myGraphView->getGraph();
GraphItem* pItem = new GraphItem(pGraph, tr("LEG_NONOPT_DISPLAY"));
pItem->setSorted(true);
pItem->setMarker(0, QColor( Qt::blue ), Qt::SolidLine);
pItem->addNode(0, 0);
pItem = new GraphItem(pGraph, tr("LEG_OPT_DISPLAY"));
pItem->setSorted(true);
pItem->setMarker(1, QColor( Qt::red ), Qt::SolidLine);
pItem->addNode(0, 0);
pItem = new GraphItem(pGraph, tr("LEG_NONOPT_UPDATE"));
pItem->setSorted(true);
pItem->setMarker(2, QColor( Qt::blue ), Qt::DotLine);
pItem->addNode(0, 0);
pItem = new GraphItem(pGraph, tr("LEG_OPT_UPDATE"));
pItem->setSorted(true);
pItem->setMarker(3, QColor( Qt::red ), Qt::DotLine);
pItem->addNode(0, 0);
pGraph->setXTitle(tr("LAB_TRIANGLES"));
pGraph->setYTitle(tr("LAB_SECONDS"));
pGraph->installEventFilter(this);
pGraph->setOperationEnabled(GraphView::voRect, true);
pGraph->setOperationEnabled(GraphView::voZoom, true);
pGraph->setOperationEnabled(GraphView::voZoomX, true);
pGraph->setOperationEnabled(GraphView::voZoomY, true);
pGraph->setOperationEnabled(GraphView::voPan, true);
pGraph->setOperationEnabled(GraphView::voPanX, true);
pGraph->setOperationEnabled(GraphView::voPanY, true);
central->setStretchFactor(0, 5);
central->setStretchFactor(1, 1);
setCentralWidget( central );
myGraphPopup = new QMenu(pGraph);
myOperations = new ViewOperations( myDocument->getContext() );
verify( connect( myView, SIGNAL( noActiveActions() ),
myOperations, SLOT( onNoActiveActions() ) ) );
verify( connect( myOperations, SIGNAL( setCursor( const QCursor& ) ),
SLOT( setCursor( const QCursor& ) ) ) );
createViewActions();
createGraphActions();
}
MDIWindow::~MDIWindow()
{
delete myGraphView;
}
Document* MDIWindow::getDocument()
{
return myDocument;
}
int MDIWindow::getDisplayMode()
{
return myOperations->getDisplayMode();
}
void MDIWindow::closeEvent(QCloseEvent* e)
{
emit sendCloseView( this );
}
void MDIWindow::createViewActions()
{
QToolBar* aToolBar = new QToolBar( tr( "View Operations" ), this );
addToolBar( Qt::TopToolBarArea, aToolBar );
QList<QAction*> aList = myOperations->getToolActions();
QActionGroup* dModeGroup = new QActionGroup( aToolBar );
QAction* a;
int i = 0;
foreach( a, aList ) {
aToolBar->addAction( a );
// if ( i == 1 )
// aToolBar->addSeparator();
if ( i == ViewOperations::ToolWireframeId || i == ViewOperations::ToolShadingId ) {
dModeGroup->addAction( a );
}
i++;
}
aToolBar->addSeparator();
aList = myOperations->getViewActions();
foreach( a, aList ) aToolBar->addAction( a );
}
void MDIWindow::setCursor(const QCursor& aCursor)
{
myView->setCursor(aCursor);
}
void MDIWindow::defineMagView()
{
myView->setCurrentAction();
}
Handle(V3d_View)& MDIWindow::getView()
{
return myView->getView();
}
void MDIWindow::activateAction( ViewOperations::Action action )
{
myView->startAction( action );
}
void MDIWindow::addResult(ResultType item, int x, double y)
{
if (item == Undefined) return;
GraphView* pGraph = myGraphView->getGraph();
pGraph->getItem((int)item)->addNode(x, y);
double xMin, xMax, yMin, yMax;
pGraph->getRange(xMin, yMin, xMax, yMax);
pGraph->fitData(0, xMax, 0, yMax);
}
bool MDIWindow::eventFilter(QObject* dstObj, QEvent* event)
{
if (event->type() == QEvent::MouseButtonPress)
{
QMouseEvent* mEvent = (QMouseEvent*)event;
if (mEvent->button() == Qt::RightButton &&
!(mEvent->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::ShiftModifier)))
graphPopup(mEvent->globalPos());
}
return FALSE;
}
void MDIWindow::createGraphActions()
{
QAction* a = new QAction( tr( "MEN_GRAPH_FIT_ALL" ), this );
a->setToolTip( tr( "TBR_GRAPH_FIT_ALL" ) );
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphFitAll() ) ) );
myGraphPopup->addAction( a );
myGraphPopup->addSeparator();
a = new QAction( tr( "MEN_GRAPH_CLEAR" ), this );
a->setToolTip( tr( "TBR_GRAPH_CLEAR" ) );
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphClear() ) ) );
myGraphPopup->addAction( a );
}
void MDIWindow::graphPopup(const QPoint& pos)
{
myGraphPopup->popup(pos);
}
void MDIWindow::onGraphClear()
{
GraphView* graph = myGraphView->getGraph();
for (int i = 0; i < graph->getNbItems(); i++)
{
graph->getItem(i)->clear();
graph->getItem(i)->addNode(0, 0);
}
graph->repaint();
}
void MDIWindow::onGraphFitAll()
{
GraphView* graph = myGraphView->getGraph();
double xMin, xMax, yMin, yMax;
graph->getRange(xMin, yMin, xMax, yMax);
graph->fitData(0, xMax, 0, yMax);
}

View File

@ -1,291 +0,0 @@
#include <qlayout.h>
#include <qpushbutton.h>
#include <qframe.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <Aspect_TypeOfLine.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <V3d_TypeOfVisualization.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Drawer.hxx>
#include "ObjectDlg.h"
#include "global.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
Handle(AIS_InteractiveContext)& cxt )
: QDialog( parent ),
myAutoApply( true ), myView( view ), myContext( cxt )
{
setModal( false );
setWindowTitle( tr( "TITLE_OBJECT_DLG" ) );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 5 );
QFrame* mainFrame = new QFrame( this );
mainFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( mainFrame );
topLayout->addSpacing( 10 );
// view properties
QGridLayout* pLayout = new QGridLayout( mainFrame );
pLayout->setMargin( 5 );
myDegModelLabel = new QLabel( tr("MEN_DLG_DEGMODEL"), mainFrame );
myDegRatioLabel = new QLabel( tr("MEN_DLG_DEGRATIO"), mainFrame );
myDegModelBox = new QComboBox( mainFrame );
myDegModelBox->addItem( tr( "MEN_DLG_NODEGENERATION" ) );
myDegModelBox->addItem( tr( "MEN_DLG_TINYDEGENERATION" ) );
myDegModelBox->addItem( tr( "MEN_DLG_WIREDEGENERATION" ) );
myDegModelBox->addItem( tr( "MEN_DLG_MARKERDEGENERATION" ) );
myDegModelBox->addItem( tr( "MEN_DLG_BBOXDEGENERATION" ) );
myCurrentDegModel = NoDegId;
myCurrentDegRatio = 0.;
verify( connect( myDegModelBox, SIGNAL( activated( int ) ), SLOT( onDegenerateModel( int ) ) ) );
//QSpinBox* degRatioSpin = new QSpinBox( mainFrame );
//QSpinBox ( QWidget * parent = 0, const char * name = 0 )
myDegRatioSpin = new QSpinBox( mainFrame );
myDegRatioSpin->setRange(0, 10);
myDegRatioSpin->setSingleStep(1);
verify( connect( myDegRatioSpin, SIGNAL( valueChanged( int ) ), SLOT( onDegRatio( int ) ) ) );
QCheckBox* showEdges = new QCheckBox( mainFrame );
showEdges->setText( tr( "BTN_SHOWEDGES" ) );
verify( connect( showEdges, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
myEdgeStyle = new QLabel( tr("MEN_DLG_EDGESTYLE"), mainFrame );
myEdgeWidth = new QLabel( tr("MEN_DLG_EDGEWIDTH"), mainFrame );
myEdgeBox = new QComboBox( mainFrame );
myEdgeBox->addItem( tr( "MEN_DLG_EDGESOLID" ) );
myEdgeBox->addItem( tr( "MEN_DLG_EDGEDASH" ) );
myEdgeBox->addItem( tr( "MEN_DLG_EDGEDOT" ) );
myEdgeBox->addItem( tr( "MEN_DLG_EDGEDOTDASH" ) );
myCurrentEdgeStyle = SolidEdgeId;
verify( connect( myEdgeBox, SIGNAL( activated( int ) ), SLOT( onEdgeStyle( int ) ) ) );
//myEdgeSpin = new QSpinBox( mainFrame );
myEdgeSpin = new QSpinBox( mainFrame );
myEdgeSpin->setRange(1, 10);
myEdgeSpin->setSingleStep(10);
verify( connect( myEdgeSpin, SIGNAL( valueChanged( int ) ), SLOT( onEdgeWidth( int ) ) ) );
onShowEdges( false );
pLayout->addWidget( myDegModelLabel, 0, 0 );
pLayout->addWidget( myDegRatioLabel, 1, 0 );
pLayout->addWidget( myDegModelBox, 0, 2 );
pLayout->addWidget( myDegRatioSpin, 1, 2 );
pLayout->addWidget( showEdges, 2, 0 );
pLayout->addWidget( myEdgeStyle, 3, 0 );
pLayout->addWidget( myEdgeWidth, 4, 0 );
pLayout->addWidget( myEdgeBox, 3, 2 );
pLayout->addWidget( myEdgeSpin, 4, 2 );
pLayout->setRowStretch( 5, 10 );
pLayout->setColumnStretch( 1, 10 );
// apply controls
QCheckBox *autoApply;
autoApply = new QCheckBox( this );
autoApply->setText( tr( "BTN_AUTOAPPLY" ) );
autoApply->setChecked( true );
verify( connect( autoApply, SIGNAL( toggled( bool ) ), SLOT( onAutoApply( bool ) ) ) );
QHBoxLayout* applyLayout = new QHBoxLayout();
applyLayout->addWidget( autoApply );
applyLayout->addStretch( 10 );
topLayout->addLayout(applyLayout);
topLayout->addSpacing( 10 );
// control buttons
QPushButton *bOk, *bCancel/*, *bHelp*/;
bOk = new QPushButton( tr( "BTN_OK" ), this );
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
QHBoxLayout* btnLayout = new QHBoxLayout();
btnLayout->setSpacing( 5 );
btnLayout->addStretch( 10 );
btnLayout->addWidget( bOk );
btnLayout->addWidget( bCancel );
btnLayout->addStretch( 10 );
// btnLayout->addWidget( bHelp );
topLayout->addLayout(btnLayout);
QSize s = topLayout->totalMinimumSize();
s.setWidth( s.width() + topLayout->margin() + 10 );
s.setHeight( s.height() + topLayout->margin() + 10 );
setFixedSize( s );
}
ObjectDlg::~ObjectDlg()
{
}
void ObjectDlg::showEvent ( QShowEvent* e )
{
QWidget::showEvent( e );
Standard_Boolean isDeg, isAnim, isEnabled;
isAnim = myView->AnimationMode( isDeg );
isEnabled = isDeg && isAnim;
myDegModelLabel->setEnabled( isEnabled );
myDegRatioLabel->setEnabled( isEnabled );
myDegModelBox->setEnabled( isEnabled );
myDegRatioSpin->setEnabled( isEnabled );
}
void ObjectDlg::onOk()
{
hide();
}
void ObjectDlg::onCancel()
{
hide();
}
void ObjectDlg::onHelp()
{
}
void ObjectDlg::onShowEdges( bool on )
{
if ( myAutoApply ) {
myEdgeStyle->setEnabled( on );
myEdgeWidth->setEnabled( on );
myEdgeBox->setEnabled( on );
myEdgeSpin->setEnabled( on );
Handle(AIS_InteractiveObject) object;
Handle(Prs3d_ShadingAspect) aspect;
myContext->InitSelected();
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
object = myContext->SelectedInteractive();
aspect = object->Attributes()->ShadingAspect();
if ( on )
aspect->Aspect()->SetEdgeOn();
else
aspect->Aspect()->SetEdgeOff();
object->SetAspect( aspect );
}
//myContext->UpdateCurrentViewer();
myView->Update();
}
}
void ObjectDlg::onDegenerateModel( int index )
{
if ( myCurrentDegModel != index ) {
switch ( index ) {
case NoDegId :
myDegModel = Aspect_TDM_NONE;
break;
case TinyDegId :
myDegModel = Aspect_TDM_TINY;
break;
case WireDegId :
myDegModel = Aspect_TDM_WIREFRAME;
break;
case MarkerDegId :
myDegModel = Aspect_TDM_MARKER;
break;
case BBoxDegId :
myDegModel = Aspect_TDM_BBOX;
break;
}
myCurrentDegModel = index;
updateDegenerationModel();
}
}
void ObjectDlg::onDegRatio( int ratio )
{
myCurrentDegRatio = ratio / 10.;
updateDegenerationModel();
}
void ObjectDlg::onEdgeStyle( int index )
{
if ( myCurrentEdgeStyle != index ) {
myCurrentEdgeStyle = index;
updateEdgeAspect( true );
}
}
void ObjectDlg::onEdgeWidth( int value )
{
myCurrentEdgeWidth = (float) value;
updateEdgeAspect( false );
}
void ObjectDlg::onAutoApply( bool on )
{
myAutoApply = on;
}
void ObjectDlg::updateEdgeAspect( bool edgeStyle )
{
Aspect_TypeOfLine type;
if ( edgeStyle )
switch( myCurrentEdgeStyle ) {
case SolidEdgeId :
type = Aspect_TOL_SOLID;
break;
case DashEdgeId :
type = Aspect_TOL_DASH;
break;
case DotEdgeId :
type = Aspect_TOL_DOT;
break;
case DotDashEdgeId :
type = Aspect_TOL_DOTDASH;
break;
}
Handle(AIS_InteractiveObject) object;
Handle(Prs3d_ShadingAspect) aspect;
myContext->InitSelected();
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
object = myContext->SelectedInteractive();
aspect = object->Attributes()->ShadingAspect();
if ( edgeStyle )
aspect->Aspect()->SetEdgeLineType( type );
else
aspect->Aspect()->SetEdgeWidth( myCurrentEdgeWidth );
object->SetAspect( aspect );
}
if ( myAutoApply )
//myContext->UpdateCurrentViewer();
myView->Viewer()->Update();
}
void ObjectDlg::updateDegenerationModel()
{
//myView->SetAnimationModeOff();
Handle(AIS_InteractiveObject) object;
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() ) {
object = myContext->SelectedInteractive();
object->SetDegenerateModel( myDegModel, myCurrentDegRatio );
}
//myView->SetAnimationModeOn();
if ( myAutoApply )
//myView->Update();
myContext->UpdateCurrentViewer();
}

View File

@ -1,357 +0,0 @@
#include <qapplication.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qframe.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <Aspect_TypeOfLine.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <V3d_TypeOfVisualization.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Drawer.hxx>
#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Sphere_Sphere.hxx>
#include <gp_Pnt.hxx>
#include "ShapeDlg.h"
#include "Application.h"
#include "MDIWindow.h"
#include "Document.h"
#include "global.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
Handle(AIS_InteractiveContext)& cxt )
: QDialog( parent ),
myView( view ), myContext( cxt )
{
setModal( false );
setWindowTitle( tr( "TITLE_SHAPE_DLG" ) );
myRadius = 100;
myDeflection = 1.0;
myNbPanes = 0;
myNbItems = 0;
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 5 );
// radius frame
QFrame* rFrame = new QFrame( this );
//rFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( rFrame );
topLayout->addSpacing( 10 );
QHBoxLayout* rBox = new QHBoxLayout( rFrame );
rBox->setMargin( 5 );
QLabel* rad = new QLabel( tr( "MEN_DLG_RADIUS" ), rFrame );
QDoubleSpinBox* rSpin = new QDoubleSpinBox( rFrame );
rSpin->setRange( 1, 10000 );
rSpin->setSingleStep( 1 );
// rSpin->setValueDouble( myRadius );
rSpin->setValue( myRadius );
// verify( connect( rSpin, SIGNAL( sbdValueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
verify( connect( rSpin, SIGNAL( valueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
rBox->addWidget( rad );
rBox->addWidget( rSpin );
rBox->addStretch( 2 );
// sphere position frame
QFrame* pFrame = new QFrame( this );
QHBoxLayout* pBox = new QHBoxLayout( pFrame );
pBox->setMargin( 5 );
pFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( pFrame );
topLayout->addSpacing( 10 );
QLabel *lX, *lY, *lZ;
lX = new QLabel( tr( "MEN_DLG_X" ), pFrame );
lY = new QLabel( tr( "MEN_DLG_Y" ), pFrame );
lZ = new QLabel( tr( "MEN_DLG_Z" ), pFrame );
myXSpin = new QDoubleSpinBox( pFrame );
myXSpin->setRange( -10000, 10000 );
myXSpin->setSingleStep( 1 );
myXSpin->setValue( 0 );
connect(myXSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
myYSpin = new QDoubleSpinBox( pFrame );
myYSpin->setRange( -10000, 10000 );
myYSpin->setSingleStep( 1 );
myYSpin->setValue( 0 );
connect(myYSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
myZSpin = new QDoubleSpinBox( pFrame );
myZSpin->setRange( -10000, 10000 );
myZSpin->setSingleStep( 1 );
myZSpin->setValue( 0 );
connect(myZSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
pBox->addStretch( 2 );
pBox->addWidget( lX );
pBox->addWidget( myXSpin );
pBox->addStretch( 2 );
pBox->addWidget( lY );
pBox->addWidget( myYSpin );
pBox->addStretch( 2 );
pBox->addWidget( lZ );
pBox->addWidget( myZSpin );
pBox->addStretch( 2 );
// sphere aspect frame
QFrame* aFrame = new QFrame( this );
QHBoxLayout* aBox = new QHBoxLayout( aFrame );
aBox->setMargin( 5 );
aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( aFrame );
topLayout->addSpacing( 10 );
myVNormal = new QCheckBox( aFrame );
myVNormal->setText( tr( "MEN_BTN_VNORMAL" ) );
myVNormal->setChecked( true );
//verify( connect( myVNormal, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
myVColor = new QCheckBox( aFrame );
myVColor->setText( tr( "MEN_BTN_VCOLOR" ) );
//verify( connect( myVColor, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
myVTexel = new QCheckBox( aFrame );
myVTexel->setText( tr( "MEN_BTN_VTEXEL" ) );
//verify( connect( myVTexel, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
myText = new QCheckBox( aFrame );
myText->setText( tr( "MEN_BTN_TEXT" ) );
verify( connect( myText, SIGNAL( clicked() ), SLOT( onText() ) ) );
aBox->addStretch( 2 );
aBox->addWidget( myVNormal );
aBox->addStretch( 2 );
aBox->addWidget( myVColor );
aBox->addStretch( 2 );
aBox->addWidget( myVTexel );
aBox->addStretch( 2 );
aBox->addWidget( myText );
aBox->addStretch( 2 );
// tesselation frame
QFrame* tFrame = new QFrame( this );
QHBoxLayout* tBox = new QHBoxLayout( tFrame );
tBox->setMargin( 5 );
tFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( tFrame );
topLayout->addSpacing( 10 );
QLabel *defl, *panes, *items;
defl = new QLabel( tr( "MEN_DLG_DEFLECTION" ), tFrame );
panes = new QLabel( tr( "MEN_DLG_PANES" ), tFrame );
items = new QLabel( tr( "MEN_DLG_ITEMS" ), tFrame );
myDefSpin = new QDoubleSpinBox( tFrame );
myDefSpin->setRange( 0.1, 13 );
myDefSpin->setSingleStep( 0.1 );
myDefSpin->setValue( 1 );
verify( connect( myDefSpin, SIGNAL( valueChanged( double ) ), SLOT( onDeflectionChanged( double ) ) ) );
myPanesSpin = new QSpinBox( tFrame );
myPanesSpin->setRange( 8, 10000 );
myPanesSpin->setSingleStep( 1 );
verify( connect( myPanesSpin, SIGNAL( valueChanged( int ) ), SLOT( onPanesChanged( int ) ) ) );
myItemsSpin = new QSpinBox( tFrame );
myItemsSpin->setRange( 25, 10000000 );
myItemsSpin->setSingleStep( 1 );
verify( connect( myItemsSpin, SIGNAL( valueChanged( int ) ), SLOT( onItemsChanged( int ) ) ) );
tBox->addWidget( defl );
tBox->addWidget( myDefSpin );
tBox->addWidget( panes );
tBox->addWidget( myPanesSpin );
tBox->addWidget( items );
tBox->addWidget( myItemsSpin );
// control buttons
QPushButton *bOk, *bCancel/*, *bHelp*/;
bOk = new QPushButton( tr( "BTN_OK" ), this );
bOk->setDefault(true);
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
verify( connect( this, SIGNAL( destroyed() ), SLOT( onCancel() ) ) );
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
QHBoxLayout* btnLayout = new QHBoxLayout();
btnLayout->setSpacing( 5 );
btnLayout->addStretch( 10 );
btnLayout->addWidget( bOk );
btnLayout->addWidget( bCancel );
btnLayout->addStretch( 10 );
// btnLayout->addWidget( bHelp );
topLayout->addLayout( btnLayout );
QSize s = topLayout->totalMinimumSize();
s.setWidth( s.width() + topLayout->margin() + 10 );
s.setHeight( s.height() + topLayout->margin() + 10 );
setFixedSize( s );
}
ShapeDlg::~ShapeDlg()
{
}
void ShapeDlg::showEvent ( QShowEvent* e )
{
QWidget::showEvent( e );
// myXSpin->setValueDouble( 0 );
// myYSpin->setValueDouble( 0 );
// myZSpin->setValueDouble( 0 );
myXSpin->setValue( 0 );
myYSpin->setValue( 0 );
myZSpin->setValue( 0 );
onRadiusChanged( myRadius );
}
void ShapeDlg::onOk()
{
hide();
updateSphere();
myShape.Nullify();
}
void ShapeDlg::onCancel()
{
hide();
myContext->Remove( myShape );
myShape.Nullify();
}
void ShapeDlg::onHelp()
{
}
void ShapeDlg::onRadiusChanged( double value )
{
myRadius = value;
myNbPanes = Sphere_Sphere::NbPanes( myRadius, myDeflection );
myNbItems = Sphere_Sphere::NbItems( myNbPanes );
myPanesSpin->blockSignals( true );
myItemsSpin->blockSignals( true );
myPanesSpin->setValue( myNbPanes );
myItemsSpin->setValue( myNbItems );
myPanesSpin->blockSignals( false );
myItemsSpin->blockSignals( false );
updateSphere();
}
void ShapeDlg::onItemsChanged( int value )
{
myNbItems = value;
myNbPanes = Sphere_Sphere::NbPanes( myNbItems );
myDeflection = Sphere_Sphere::Deflection( myRadius, myNbPanes );
myDefSpin->blockSignals( true );
myPanesSpin->blockSignals( true );
// myDefSpin->setValueDouble( myDeflection );
myDefSpin->setValue( myDeflection );
myPanesSpin->setValue( myNbPanes );
myDefSpin->blockSignals( false );
myPanesSpin->blockSignals( false );
updateSphere();
}
void ShapeDlg::onPanesChanged( int value )
{
myNbPanes = value;
myNbItems = Sphere_Sphere::NbItems( myNbPanes );
myDeflection = Sphere_Sphere::Deflection( myRadius, myNbPanes );
myDefSpin->blockSignals( true );
myItemsSpin->blockSignals( true );
// myDefSpin->setValueDouble( myDeflection );
myDefSpin->setValue( myDeflection );
myItemsSpin->setValue( myNbItems );
myDefSpin->blockSignals( false );
myItemsSpin->blockSignals( false );
updateSphere();
}
void ShapeDlg::onDeflectionChanged( double value )
{
myDeflection = value;
myNbPanes = Sphere_Sphere::NbPanes( myRadius, myDeflection );
myNbItems = Sphere_Sphere::NbItems( myNbPanes );
myPanesSpin->blockSignals( true );
myItemsSpin->blockSignals( true );
myPanesSpin->setValue( myNbPanes );
myItemsSpin->setValue( myNbItems );
myPanesSpin->blockSignals( false );
myItemsSpin->blockSignals( false );
updateSphere();
}
void ShapeDlg::onText()
{
updateSphere();
}
void ShapeDlg::updateSphere()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
bool visible = isVisible();
gp_Pnt myPosition( myXSpin->value(), myYSpin->value(), myZSpin->value() );
if ( !myShape.IsNull() ) {
myContext->Remove( myShape, false );
myShape.Nullify();
}
myShape =
new Sphere_Sphere( myPosition, myRadius, myDeflection, 1/*myVNormalsFlag*/,
0/*myVColorsFlag*/, 0/*myVTexelsFlag*/, myText->isChecked(), Graphic3d_ArrayOfPrimitives::IsEnable());
myContext->SetDisplayMode( myShape, Application::getApplication()->getActiveMDI()->getDisplayMode(), false );
Application::startTimer();
myContext->Display( myShape, false );
Application::stopTimer( 0, "Display Sphere::Sphere", !visible );
Application::startTimer();
myView->Update();
Application::stopTimer( 0, "UPDATE", !visible );
QApplication::restoreOverrideCursor();
}
void ShapeDlg::onPositionChanged()
{
updateSphere();
}
void ShapeDlg::closeEvent ( QCloseEvent* e )
{
onCancel();
}

View File

@ -1,71 +0,0 @@
#define xG005
#include <Sphere_BasicShape.ixx>
#include <TopLoc_Location.hxx>
#include <gp_Trsf.hxx>
#include <gp_XYZ.hxx>
//==================================================
// Function:
// Purpose :
//==================================================
Sphere_BasicShape::Sphere_BasicShape(const TopoDS_Shape& aShape,
const Standard_Real aDeflection,
const Standard_Boolean hasVNormals,
const Standard_Boolean hasVColors,
const Standard_Boolean hasVTexels
) :
AIS_Shape(aShape),
myDeflection(aDeflection),
myVNormalsFlag(hasVNormals),
myVColorsFlag(hasVColors),
myVTexelsFlag(hasVTexels)
{
}
void Sphere_BasicShape::SetPosition(const gp_Pnt& aPosition) {
gp_Trsf trsf;
trsf.SetTranslationPart(gp_Vec(aPosition.XYZ()));
TopLoc_Location location(trsf);
myshape.Location(location);
}
gp_Pnt Sphere_BasicShape::Position() const {
TopLoc_Location location = myshape.Location();
gp_Trsf trsf = location.Transformation();
gp_XYZ xyz = trsf.TranslationPart();
return gp_Pnt(xyz.X(),xyz.Y(),xyz.Z());
}
void Sphere_BasicShape::SetVNormals(const Standard_Boolean aFlag) {
myVNormalsFlag = aFlag;
}
Standard_Boolean Sphere_BasicShape::VNormalsFlag() const {
return myVNormalsFlag;
}
void Sphere_BasicShape::SetVColors(const Standard_Boolean aFlag) {
myVColorsFlag = aFlag;
}
Standard_Boolean Sphere_BasicShape::VColorsFlag() const {
return myVColorsFlag;
}
void Sphere_BasicShape::SetVTexels(const Standard_Boolean aFlag) {
myVTexelsFlag = aFlag;
}
Standard_Boolean Sphere_BasicShape::VTexelsFlag() const {
return myVTexelsFlag;
}
void Sphere_BasicShape::SetDeflection(const Standard_Real aValue) {
myDeflection = aValue;
}
Standard_Real Sphere_BasicShape::Deflection() const {
return myDeflection;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,172 +0,0 @@
#include <qfiledialog.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include "Translate.h"
#include "Application.h"
#include "Document.h"
#include "MDIWindow.h"
#include "global.h"
#include <StlAPI_Writer.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Shape.hxx>
#include <TopoDS_Shape.hxx>
#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>
#include <Geom_Surface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Line.hxx>
#include <PTColStd_TransientPersistentMap.hxx>
#include <TopoDS_Compound.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
// STL
//#include <Mesh_InteractiveObject.hxx>
//#include <Mesh_STLRead.hxx>
//#include <Mesh_Drawer.hxx>
//#include <Mesh_Model.hxx>
#ifdef a
#include "OSD_Timer.hxx"
#include <FSD_File.hxx>
#include <ShapeSchema.hxx>
#include <Storage_Data.hxx>
#include <PTopoDS_HShape.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Storage_Root.hxx>
#include <PTColStd_PersistentTransientMap.hxx>
#include <MgtBRep.hxx>
#include <TCollection_ExtendedString.hxx>
#include <IGESControl_Reader.hxx>
#include <IGESControl_Controller.hxx>
#include <IGESControl_Writer.hxx>
#include <Interface_Static.hxx>
#include <STEPControl_Reader.hxx>
#include <Interface_TraceFile.hxx>
#include <STEPControl_Writer.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <VrmlAPI_Writer.hxx>
#endif
Translate::Translate( QObject* parent ):
QObject( parent )
{
}
Translate::~Translate()
{
}
/*!
Selects a file from standard dialog acoording to selection
'filter'
*/
QString Translate::selectFileName( const QString& filter, bool isImport ) const
{
return isImport ?
QFileDialog::getOpenFileName( QApplication::activeWindow(), tr("INF_APP_IMPORT"), QString::null, filter ) :
QFileDialog::getSaveFileName( QApplication::activeWindow(), tr("INF_APP_EXPORT"), QString::null, filter );
/*
QFileDialog fd ( 0, 0, true );
fd.setFilters( filter );
if(isImport)
fd.setCaption ( tr("INF_APP_IMPORT") );
int ret = fd.exec();
qApp->processEvents();
return ( ret == QDialog::Accepted ? fd.selectedFile() : QString::null );
*/
}
Handle(TopTools_HSequenceOfShape)
Translate::BuildSequenceFromContext(const Handle(AIS_InteractiveContext)& cxt)
{
Handle(TopTools_HSequenceOfShape) sequence = new TopTools_HSequenceOfShape();
Handle(AIS_InteractiveObject) object;
AIS_ListOfInteractive displayed;
cxt->DisplayedObjects( displayed );
AIS_ListIteratorOfListOfInteractive it( displayed );
for ( ; it.More(); it.Next() ) {
object = it.Value();
if ( object->IsKind( STANDARD_TYPE( AIS_Shape ) ) ) {
TopoDS_Shape shape = Handle(AIS_Shape)::DownCast( object )->Shape();
sequence->Append( shape );
}
}
#ifdef OLD_CODE
for(anInteractiveContext->InitCurrent();anInteractiveContext->MoreCurrent();anInteractiveContext->NextCurrent())
{
picked = anInteractiveContext->Current();
if (anInteractiveContext->Current()->IsKind(STANDARD_TYPE(AIS_Shape)))
{
TopoDS_Shape aShape = Handle(AIS_Shape)::DownCast(picked)->Shape();
aSequence->Append(aShape);
}
}
#endif //OLD_CODE
return sequence;
}
void Translate::importBREP(const Handle(AIS_InteractiveContext) theContext)
{
static QString filter = "BREP Files (*.brep )";
importBREP(theContext,filter);
}
void Translate::importBREP(const Handle(AIS_InteractiveContext) theContext, const QString& filter)
{
QString file = selectFileName( filter, true );
if ( !file.isNull() ) {
QApplication::setOverrideCursor( Qt::WaitCursor );
if(!importBREP(theContext, (const Standard_CString) file.toLatin1().constData())) {
QApplication::restoreOverrideCursor();
QMessageBox::information ( QApplication::activeWindow(),tr("TIT_ERROR"), tr("INF_TRANSLATE_ERROR"), tr("BTN_OK"),
QString::null, QString::null, 0, 0);
qApp->processEvents(); /* update desktop */
} else
QApplication::restoreOverrideCursor();
}
}
bool Translate::importBREP(const Handle(AIS_InteractiveContext) theContext, const Standard_CString theFileName)
{
Handle(TopTools_HSequenceOfShape) aSequence = new TopTools_HSequenceOfShape();
TopoDS_Shape aShape;
BRep_Builder aBuilder;
Application::startTimer();
Standard_Boolean result = BRepTools::Read(aShape,theFileName,aBuilder);
Application::stopTimer( 0, "Loading BREP file" );
if(result)
aSequence->Append(aShape);
int curMode =
( (MDIWindow*)Application::getApplication()->getActiveMDI() )->getDisplayMode();
for(int i=1;i<= aSequence->Length();i++) {
Application::startTimer();
Handle(AIS_Shape) shape = new AIS_Shape( aSequence->Value( i ) );
Application::stopTimer( 0, "Build shape" );
Application::startTimer();
theContext->Display( shape, curMode, 0, false );
Application::stopTimer( 0, "Display" );
}
Application::startTimer();
theContext->UpdateCurrentViewer();
Application::stopTimer( 0, "Update" );
return result;
}

View File

@ -1,883 +0,0 @@
#if !defined WNT
#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */
#endif
#include <qapplication.h>
#include <qpainter.h>
#include <qmenu.h>
#include <qcolordialog.h>
#include <qcursor.h>
#include <qevent.h>
#include <qrubberband.h>
#include "View.h"
#include "global.h"
#include "Application.h"
#include "ViewOperations.h"
#include <V3d_PerspectiveView.hxx>
#include <Visual3d_View.hxx>
#include <Graphic3d_NameOfMaterial.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepPrimAPI_MakeTorus.hxx>
#include <gp_Pnt.hxx>
#include <gp.hxx>
#include <Geom_Axis2Placement.hxx>
#include <AIS_Shape.hxx>
#include <AIS_Line.hxx>
#include <Geom_Line.hxx>
#include <AIS_Trihedron.hxx>
//#include <TopAbs_ShapeEnum.hxx>
#ifdef WNT
#include <WNT_Window.hxx>
#include <Graphic3d_WNTGraphicDevice.hxx>
#else
#include <GL/glx.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xmu/StdCmap.h>
#undef QT_CLEAN_NAMESPACE
#include <Xw_Window.hxx>
#include <Graphic3d_GraphicDevice.hxx>
#endif
// the key for multi selection :
#define MULTISELECTIONKEY Qt::ShiftModifier
// the key for shortcut ( use to activate dynamic rotation, panning )
#define CASCADESHORTCUTKEY Qt::ControlModifier
// for elastic bean selection
#define ValZWMin 1
View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi )
: QWidget( parent ), myMDI( mdi ), myRubberBand( 0 )
{
setBackgroundRole( QPalette::NoRole );//NoBackground );
// set focus policy to threat QContextMenuEvent from keyboard
setFocusPolicy( Qt::StrongFocus );
setAttribute( Qt::WA_PaintOnScreen );
setAttribute( Qt::WA_NoSystemBackground );
#ifndef WNT
XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX();
#endif
myObjDlg = NULL;
myShapeDlg = NULL;
myFirst = true;
myContext = theContext;
myCycleCounter = -1;
myXmin=0;
myYmin=0;
myXmax=0;
myYmax=0;
myCurZoom=0;
#if !defined WNT
XVisualInfo* pVisualInfo;
if ( x11Display() ) {
/* Initialization with the default VisualID
*/
Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
int visualID = XVisualIDFromVisual( v );
/* Here we use the settings from
Optimizer_ViewInfo::TxglCreateWindow()
*/
int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1,
GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER,
None };
pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr);
if ( isVisible() )
hide();
XSetWindowAttributes a;
Window p = RootWindow( x11Display(), DefaultScreen(x11Display()) );
a.colormap = XCreateColormap( x11Display(), RootWindow(x11Display(),
pVisualInfo->screen), pVisualInfo->visual, AllocNone );
a.background_pixel = backgroundColor().pixel();
a.border_pixel = black.pixel();
if ( parentWidget() )
p = parentWidget()->winId();
Window w = XCreateWindow( x11Display(), p, x(), y(), width(), height(),
0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
CWBackPixel | CWBorderPixel | CWColormap, &a );
Window *cmw;
Window *cmwret;
int count;
if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(),
&cmwret, &count ) ) {
cmw = new Window[count+1];
memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );
XFree( (char *)cmwret );
int i;
for (i = 0; i < count; i++) {
if ( cmw[i] == winId() ) { /* replace old window */
cmw[i] = w;
break;
}
}
if ( i >= count ) /* append new window */
cmw[count++] = w;
} else {
count = 1;
cmw = new Window[count];
cmw[0] = w;
}
/* Creating new window (with good VisualID) for this widget */
create( w );
XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
delete [] cmw;
if ( isVisible() )
show();
if ( pVisualInfo ) {
XFree( (char *)pVisualInfo );
}
XFlush( x11Display() );
}
#endif // !defined WNT
// will be set in OnInitial update, but, for more security :
myCurrentMode = CurAction3d_Nothing;
setMouseTracking( true );
myView = NULL;
}
View::~View()
{
}
void View::init()
{
myView = myContext->CurrentViewer()->CreateView();
int windowHandle = (int) winId();
short hi, lo;
lo = (short) windowHandle;
hi = (short) ( windowHandle >> 16 );
#ifdef WNT
Handle(WNT_Window) hWnd =
new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::
DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo );
#else
Handle(Xw_Window) hWnd =
new Xw_Window( Handle(Graphic3d_GraphicDevice)::
DownCast( myContext->CurrentViewer()->Device() ),
(int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK );
#endif // WNT
myView->SetWindow( hWnd );
if ( !hWnd->IsMapped() )
hWnd->Map();
myView->SetBackgroundColor(Quantity_NOC_GRAY40);
myView->MustBeResized();
Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() );
myTrihedron = new AIS_Trihedron( anAxis );
myContext->Display( myTrihedron );
//myView->SetAntialiasingOn();
myComputedModeIsOn = true;
myView->SetScale(3.0316);
// This is to update View properties dialog
emit ViewInitialized();
}
void View::paintEvent ( QPaintEvent * e)
{
if(myFirst) {
init();
myFirst = false;
}
QApplication::setOverrideCursor( Qt::WaitCursor );
Application::startTimer();
myView->Redraw();
Application::stopTimer( 0, "View REDRAW", false );
QApplication::restoreOverrideCursor();
}
void View::resizeEvent ( QResizeEvent * e)
{
// QApplication::syncX();
if(!myView.IsNull()) {
myView->MustBeResized();
}
}
void View::mousePressEvent(QMouseEvent* e)
{
if ( e->button() == Qt::LeftButton ) {
onLButtonDown(e->modifiers(),e->pos());
} else if(e->button() == Qt::RightButton ) {
onRButtonDown(e->modifiers(),e->pos());
}
}
void View::mouseReleaseEvent(QMouseEvent* e)
{
if ( e->button() == Qt::LeftButton ) {
onLButtonUp(e->modifiers(),e->pos());
} else if(e->button() == Qt::RightButton ) {
onRButtonUp(e->modifiers(),e->pos());
}
}
void View::mouseMoveEvent(QMouseEvent* e)
{
onMouseMove(e->buttons(),e->modifiers(),e->pos());
}
void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
{
// save the current mouse coordinate in min
myXmin=point.x(); myYmin=point.y();
myXmax=point.x(); myYmax=point.y();
if ( nFlags == CASCADESHORTCUTKEY ) {
// Button MB1 down Control :start zomming
// SetCursor(AfxGetApp()->LoadStandardCursor());
}
else { // if ( Ctrl )
switch (myCurrentMode) {
case CurAction3d_Nothing : // start a drag
if (nFlags == MULTISELECTIONKEY)
MultiDragEvent(myXmax,myYmax,-1);
else
DragEvent(myXmax,myYmax,-1);
break;
case CurAction3d_DynamicZooming : // noting
break;
case CurAction3d_WindowZooming :
case CurAction3d_MagnifyView :
break;
case CurAction3d_DynamicPanning :// noting
break;
case CurAction3d_GlobalPanning :// noting
break;
case CurAction3d_DynamicRotation :
if (!myComputedModeIsOn){
myView->SetComputedMode(false);
}
myView->SetAnimationModeOn();
myView->StartRotation(point.x(),point.y());
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}
}
}
void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
{
if ( nFlags == CASCADESHORTCUTKEY ) {
if ( !myComputedModeIsOn )
myView->SetComputedMode(false);
// Standard_Boolean anim, deg;
// anim = myView->AnimationMode( deg );
// if ( anim /*&& deg*/ ) {
myCycleCounter = 0;
Application::startTimer();
myView->SetAnimationModeOn();
// myView->SetAnimationMode(true,true);
// myContext->DeactivateStandardMode( TopAbs_SHAPE );
// }
myView->StartRotation( point.x(),point.y() );
}
else
Popup();
}
void View::onLButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
{
if ( nFlags == CASCADESHORTCUTKEY )
{
return;
}
else // if ( Ctrl )
{
switch ( myCurrentMode )
{
case CurAction3d_Nothing :
if (point.x() == myXmin && point.y() == myYmin)
{ // no offset between down and up --> selectEvent
myXmax=point.x();
myYmax=point.y();
if (nFlags == MULTISELECTIONKEY )
MultiInputEvent(point.x(),point.y());
else
InputEvent (point.x(),point.y());
} else
{
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
myXmax=point.x();
myYmax=point.y();
if (nFlags == MULTISELECTIONKEY)
MultiDragEvent(point.x(),point.y(),1);
else
DragEvent(point.x(),point.y(),1);
}
break;
case CurAction3d_DynamicZooming :
// SetCursor(AfxGetApp()->LoadStandardCursor());
myCurrentMode = CurAction3d_Nothing;
emit noActiveActions();
break;
case CurAction3d_WindowZooming :
case CurAction3d_MagnifyView :
DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_False );
myXmax = point.x();
myYmax = point.y();
if ( ( abs( myXmin - myXmax ) > ValZWMin ) ||
( abs( myYmin - myYmax ) > ValZWMin ) ) {
if ( myCurrentMode == CurAction3d_MagnifyView )
myMDI->getDocument()->createMagView( myXmin, myYmin, myXmax, myYmax );
else
myView->WindowFitAll( myXmin, myYmin, myXmax, myYmax );
}
myCurrentMode = CurAction3d_Nothing;
emit noActiveActions();
break;
case CurAction3d_DynamicPanning :
myCurrentMode = CurAction3d_Nothing;
emit noActiveActions();
break;
case CurAction3d_GlobalPanning :
myView->Place(point.x(),point.y(),myCurZoom);
myCurrentMode = CurAction3d_Nothing;
emit noActiveActions();
break;
case CurAction3d_DynamicRotation :
myCurrentMode = CurAction3d_Nothing;
myView->SetAnimationModeOff();
emit noActiveActions();
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
}
void View::onRButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
{
QApplication::setOverrideCursor( Qt::WaitCursor );
// reset computed mode according to the stored one
// --> dynamic rotation may have change it
if (!myComputedModeIsOn)
{
myView->SetComputedMode(false);
myComputedModeIsOn = Standard_False;
} else
{
myView->SetComputedMode(false);
myComputedModeIsOn = Standard_True;
}
//if ( myView->AnimationModeIsOn() ) {
myView->SetAnimationModeOff();
Application::stopTimer( myCycleCounter, "Animation next UPDATE", false );
//}
myCycleCounter = -1;
myView->Update();
QApplication::restoreOverrideCursor();
}
void View::onMouseMove(Qt::MouseButtons btns, Qt::KeyboardModifiers nFlags, const QPoint point)
{
// ============================ LEFT BUTTON =======================
if ( btns == Qt::LeftButton ) {
if ( nFlags == CASCADESHORTCUTKEY )
{
// move with MB1 and Control : on the dynamic zooming
// Do the zoom in function of mouse's coordinates
myView->Zoom(myXmax,myYmax,point.x(),point.y());
// save the current mouse coordinate in min
myXmax = point.x();
myYmax = point.y();
}
else // if ( Ctrl )
{
switch (myCurrentMode)
{
case CurAction3d_Nothing :
myXmax = point.x();
myYmax = point.y();
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);
if (nFlags == MULTISELECTIONKEY)
MultiDragEvent(myXmax,myYmax,0);
else
DragEvent(myXmax,myYmax,0);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);
break;
case CurAction3d_DynamicZooming :
myView->Zoom(myXmax,myYmax,point.x(),point.y());
// save the current mouse coordinate in min \n";
myXmax=point.x(); myYmax=point.y();
break;
case CurAction3d_WindowZooming :
case CurAction3d_MagnifyView :
myXmax = point.x(); myYmax = point.y();
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_False);//,LongDash);
DrawRectangle(myXmin,myYmin,myXmax,myYmax,Standard_True);//,LongDash);
break;
case CurAction3d_DynamicPanning :
myView->Pan(point.x()-myXmax,myYmax-point.y()); // Realize the panning
myXmax = point.x();
myYmax = point.y();
break;
case CurAction3d_GlobalPanning : // nothing
break;
case CurAction3d_DynamicRotation :
myView->Rotation(point.x(),point.y());
// myView->Redraw();
break;
default :
Standard_Failure::Raise(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags == CASCADESHORTCUTKEY ) else
} else // if ( btns == MK_LBUTTON)
// ============================ MIDDLE BUTTON =======================
if ( btns == Qt::MidButton ) {
if ( nFlags == CASCADESHORTCUTKEY )
{
myView->Pan(point.x()-myXmax,myYmax-point.y()); // Realize the panning
myXmax = point.x();
myYmax = point.y();
}
} else // if ( btns == MK_MBUTTON)
// ============================ RIGHT BUTTON =======================
if ( btns == Qt::RightButton ) {
if ( nFlags == CASCADESHORTCUTKEY )
{
myView->Rotation(point.x(),point.y());
}
}else //if ( btns == MK_RBUTTON)
// ============================ NO BUTTON =======================
{ // No buttons
myXmax = point.x(); myYmax = point.y();
if (nFlags == MULTISELECTIONKEY)
MultiMoveEvent(point.x(),point.y());
else
MoveEvent(point.x(),point.y());
}
//Standard_Boolean anim, deg;
//anim = myView->AnimationMode( deg );
//if ( anim /*&& deg*/ ) {
if ( myCycleCounter != -1 ) {
if ( myCycleCounter == 0 )
Application::showTimer( "Animation first UPDATE" );
myCycleCounter++;
}
//}
}
void View::DragEvent( int x, int y, int TheState )
{
// TheState == -1 button down
// TheState == 0 move
// TheState == 1 button up
static int theButtonDownX=0;
static int theButtonDownY=0;
if (TheState == -1)
{
theButtonDownX=x;
theButtonDownY=y;
}
if (TheState == 0) {
myContext->Select(theButtonDownX,theButtonDownY,x,y,myView);
}
}
void View::InputEvent( int x, int y )
{
Application::startTimer();
myContext->Select();
Application::stopTimer( 0, "Single selection", false );
}
void View::MoveEvent( int x, int y )
{
myContext->MoveTo(x,y,myView);
}
void View::MultiMoveEvent( int x, int y )
{
myContext->MoveTo(x,y,myView);
}
void View::MultiDragEvent( int x, int y, int TheState )
{
static int theButtonDownX=0;
static int theButtonDownY=0;
if (TheState == -1)
{ theButtonDownX=x; theButtonDownY=y;}
if (TheState == 0) {
myContext->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
emit selectionChanged();
}
}
void View::MultiInputEvent( int x, int y )
{
myContext->ShiftSelect();
emit selectionChanged();
}
void View::Popup()
{
QMenu* popMenu = new QMenu( this );
if( myContext->NbCurrents()) {
QAction* a;
myContext->InitCurrent();
if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron)))
{
a = new QAction( tr( "MEN_POP_OBJPROP" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) );
popMenu->addAction( a );
QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) );
a = new QAction( tr( "MEN_POP_WIREFRAME" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) );
dMode->addAction( a );
a = new QAction( tr( "MEN_POP_SHADING" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) );
dMode->addAction( a );
}
a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) );
popMenu->addAction( a );
}
else {
QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this );
verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) );
popMenu->addAction( a );
a = new QAction( tr( "MEN_POP_IMPORT" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) );
popMenu->addAction( a );
popMenu->addSeparator();
if ( myContext->IsDisplayed( myTrihedron ) ) {
a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) );
popMenu->addAction( a );
}
else {
a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) );
popMenu->addAction( a );
}
popMenu->addSeparator();
a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) );
popMenu->addAction( a );
QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) );
a = new QAction( tr( "MEN_POP_BOX" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) );
loadObj->addAction( a );
a = new QAction( tr( "MEN_POP_SPHERE" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) );
loadObj->addAction( a );
a = new QAction( tr( "MEN_POP_TORUS" ), this );
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) );
loadObj->addAction( a );
// a = new QAction( tr( "MEN_POP_LINE" ), this );
// verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) );
// loadObj->addAction( a );
}
popMenu->exec( QCursor::pos() );
}
void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw )
{
if ( !myRubberBand )
myRubberBand = new QRubberBand( QRubberBand::Rectangle, this );
myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() );
myRubberBand->setVisible( Draw );
/*
QPainter thePainter(this);
thePainter.setRasterOp(Qt::XorROP);
thePainter.setPen(Qt::white);
static int StoredMinX, StoredMaxX, StoredMinY, StoredMaxY;
static bool m_IsVisible;
QRect aRect;
if ( m_IsVisible && !Draw) // move or up : erase at the old position
{
aRect.setRect( StoredMinX, StoredMinY, abs(StoredMaxX-StoredMinX), abs(StoredMaxY-StoredMinY));
thePainter.drawRect(aRect);
m_IsVisible = false;
}
StoredMinX = (MinX < MaxX) ? MinX: MaxX ;
StoredMinY = (MinY < MaxY) ? MinY: MaxY ;
StoredMaxX = (MinX > MaxX) ? MinX: MaxX ;
StoredMaxY = (MinY > MaxY) ? MinY: MaxY ;
if (Draw) // move : draw
{
aRect.setRect( StoredMinX, StoredMinY, abs(StoredMaxX-StoredMinX), abs(StoredMaxY-StoredMinY));
thePainter.drawRect(aRect);
m_IsVisible = true;
}
*/
}
void View::onImportObject()
{
Application::getApplication()->importBREP();
}
void View::setCurrentAction()
{
myCurrentMode = CurAction3d_MagnifyView;
}
void View::onBackground()
{
QColor aColor ;
Standard_Real R1;
Standard_Real G1;
Standard_Real B1;
myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
aColor.setRgb(R1*255,G1*255,B1*255);
QColor aRetColor = QColorDialog::getColor(aColor);
if(aRetColor.isValid()) {
R1 = aRetColor.red()/255.;
G1 = aRetColor.green()/255.;
B1 = aRetColor.blue()/255.;
myView->SetBackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
}
myView->Redraw();
}
Handle(V3d_View)& View::getView()
{
return myView;
}
void View::startAction( ViewOperations::Action action )
{
switch( action ) {
case ViewOperations::ViewFitAllId :
myView->FitAll();
break;
case ViewOperations::ViewFitAreaId :
myCurrentMode = CurAction3d_WindowZooming;
break;
case ViewOperations::ViewZoomId :
myCurrentMode = CurAction3d_DynamicZooming;
break;
case ViewOperations::ViewPanId :
myCurrentMode = CurAction3d_DynamicPanning;
break;
case ViewOperations::ViewGlobalPanId :
myCurZoom = myView->Scale();
// Do a Global Zoom
myView->FitAll();
// Set the mode
myCurrentMode = CurAction3d_GlobalPanning;
break;
case ViewOperations::ViewFrontId :
myView->SetProj( V3d_Xpos );
myView->FitAll();
break;
case ViewOperations::ViewBackId :
myView->SetProj( V3d_Xneg );
myView->FitAll();
break;
case ViewOperations::ViewTopId :
myView->SetProj( V3d_Zpos );
myView->FitAll();
break;
case ViewOperations::ViewBottomId :
myView->SetProj( V3d_Zneg );
myView->FitAll();
break;
case ViewOperations::ViewLeftId :
myView->SetProj( V3d_Ypos );
myView->FitAll();
break;
case ViewOperations::ViewRightId :
myView->SetProj( V3d_Yneg );
myView->FitAll();
break;
case ViewOperations::ViewAxoId :
myView->SetProj( V3d_XposYnegZpos );
myView->FitAll();
break;
case ViewOperations::ViewRotationId :
myCurrentMode = CurAction3d_DynamicRotation;
break;
case ViewOperations::ViewResetId :
myView->Reset();
break;
}
}
void View::onCreateShape()
{
myView->SetScale(3.0316);
if ( !myShapeDlg )
myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext );
myShapeDlg->show();
}
void View::onLoadBox()
{
myView->SetScale(1.0);
Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.;
gp_Pnt origin( -size / 2., -size / 2., -size / 2. );
//myContext->DefaultDrawer()->ShadingAspect()->SetColor(Quantity_NOC_RED);
Handle(AIS_Shape) box =
new AIS_Shape( BRepPrimAPI_MakeBox( origin, size, size, size ).Shape() );
myContext->SetDisplayMode( box, myMDI->getDisplayMode(), false );
Application::startTimer();
myContext->Display( box, false );
Application::stopTimer( 0, "Display Box" );
Application::startTimer();
myView->Update();
Application::stopTimer( 0, "UPDATE" );
}
void View::onLoadSphere()
{
myView->SetScale(1.0);
Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.;
Handle(AIS_Shape) sphere =
new AIS_Shape( BRepPrimAPI_MakeSphere( radius ).Shape() );
myContext->SetDisplayMode( sphere, myMDI->getDisplayMode(), false );
Application::startTimer();
myContext->Display( sphere, false );
Application::stopTimer( 0, "Display Sphere" );
Application::startTimer();
//myContext->UpdateCurrentViewer();
myView->Update();
Application::stopTimer( 0, "UPDATE" );
}
void View::onLoadTorus()
{
myView->SetScale(1.0);
Handle(V3d_Viewer) viewer = myContext->CurrentViewer();
Standard_Real r1 = viewer->DefaultViewSize() / 3.;
Standard_Real r2 = viewer->DefaultViewSize() / 6.;
Handle(AIS_Shape) torus = new AIS_Shape( BRepPrimAPI_MakeTorus( r1,r2 ).Shape() );
myContext->SetDisplayMode( torus, myMDI->getDisplayMode(), false );
Application::startTimer();
myContext->Display( torus, false );
Application::stopTimer( 0, "Display Torus" );
Application::startTimer();
//myContext->UpdateCurrentViewer();
myView->Update();
Application::stopTimer( 0, "UPDATE" );
}
void View::onLoadLine()
{
myView->SetScale(1.0);
Handle(AIS_Line) line =
new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) );
myContext->Display( line );
myContext->UpdateCurrentViewer();
}
void View::onEditObjectProperties()
{
if ( !myObjDlg )
myObjDlg = new ObjectDlg( Application::getApplication(), myView, myContext );
myObjDlg->show();
}
void View::onRemoveObject()
{
myContext->InitSelected();
for( ; myContext->MoreSelected(); myContext->InitSelected() )
myContext->Remove( myContext->SelectedInteractive(), false );
myContext->UpdateCurrentViewer();
}
void View::onWireframeMode()
{
myContext->InitSelected();
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();
//myContext->Erase( obj, false );
//myContext->Display( obj, /*0, 0,*/ false );
//myContext->Activate( obj, 0 );
myContext->SetDisplayMode( obj, 0 );
}
myContext->UpdateCurrentViewer();
}
void View::onShadingMode()
{
myContext->InitSelected();
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();
//myContext->Erase( obj, false );
//myContext->Display( obj /*, 1, 0*/, false );
//myContext->Activate( obj, 0 );
myContext->SetDisplayMode( obj, 1 );
}
myContext->UpdateCurrentViewer();
}
void View::onDisplayTrihedron()
{
myContext->Display( myTrihedron );
}
void View::onEraseTrihedron()
{
myContext->Erase( myTrihedron );
}

View File

@ -1,248 +0,0 @@
// ViewDlg.cpp: implementation of the ViewDlg class.
//
//////////////////////////////////////////////////////////////////////
#include <qlayout.h>
#include <qpushbutton.h>
#include <qframe.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <V3d_TypeOfVisualization.hxx>
#include "Application.h"
#include "ViewDlg.h"
#include "global.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
:QDialog( parent ),
myAutoApply( true ), /*myView( view ),*/ myApplyAllViews(false)
{
setModal( false );
setWindowTitle( tr( "TITLE_VIEW_DLG" ) );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 5 );
QFrame* mainFrame = new QFrame( this );
mainFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
topLayout->addWidget( mainFrame );
topLayout->addSpacing( 10 );
// view properties
QGridLayout* pLayout = new QGridLayout( mainFrame );
pLayout->setMargin( 5 );
myZBufferBox = new QCheckBox( mainFrame );;
myZBufferBox->setText( tr( "BTN_ZBUFFER" ) );
verify( connect( myZBufferBox, SIGNAL( toggled( bool ) ), SLOT( onZBuffer( bool ) ) ) );
myAnimBox = new QCheckBox( mainFrame );
myAnimBox->setText( tr( "BTN_ANIMATION" ) );
verify( connect( myAnimBox, SIGNAL( toggled( bool ) ), SLOT( onAnimation( bool ) ) ) );
myDegBox = new QCheckBox( mainFrame );
myDegBox->setText( tr( "BTN_DEGENERATION" ) );
verify( connect( myDegBox, SIGNAL( toggled( bool ) ), SLOT( onDegeneration( bool ) ) ) );
pLayout->addWidget( myZBufferBox, 0, 0 );
pLayout->addWidget( myAnimBox, 1, 0 );
pLayout->addWidget( myDegBox, 2, 0 );
pLayout->setRowStretch( 3, 10 );
pLayout->setColumnStretch( 1, 10 );
// apply controls
QCheckBox *autoApply, *applyAllViews;
autoApply = new QCheckBox( this );
autoApply->setText( tr( "BTN_AUTOAPPLY" ) );
autoApply->setChecked( true );
verify( connect( autoApply, SIGNAL( toggled( bool ) ), SLOT( onAutoApply( bool ) ) ) );
applyAllViews = new QCheckBox( this );
applyAllViews->setText( tr( "BTN_APPLYALLVIEWS" ) );
verify( connect( applyAllViews, SIGNAL( toggled( bool ) ),
SLOT( onApplyAllViews( bool ) ) ) );
QHBoxLayout* applyLayout = new QHBoxLayout();
applyLayout->addWidget( autoApply );
applyLayout->addStretch( 10 );
applyLayout->addWidget( applyAllViews );
topLayout->addLayout( applyLayout );
topLayout->addSpacing( 10 );
// control buttons
QPushButton *bOk, *bCancel/*, *bHelp*/;
bOk = new QPushButton( tr( "BTN_OK" ), this );
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
bOk->setDefault(true);
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
QHBoxLayout* btnLayout = new QHBoxLayout();
btnLayout->setSpacing( 5 );
btnLayout->addStretch( 10 );
btnLayout->addWidget( bOk );
btnLayout->addWidget( bCancel );
btnLayout->addStretch( 10 );
// btnLayout->addWidget( bHelp );
topLayout->addLayout( btnLayout );
QSize s = topLayout->totalMinimumSize();
s.setWidth( s.width() + topLayout->margin() + 10 );
s.setHeight( s.height() + topLayout->margin() + 10 );
setFixedSize( s );
Handle(V3d_View) aView = Application::getApplication()->getActiveMDI()->getView();
myIsAnim = aView->AnimationMode(myIsDeg);
}
ViewDlg::~ViewDlg()
{
}
void ViewDlg::showEvent ( QShowEvent* e )
{
Update();
QWidget::showEvent( e );
}
void ViewDlg::onOk()
{
hide();
bool Auto = myAutoApply;
myAutoApply = true;
onZBuffer(myZBufferBox->isChecked());
onAnimation(myAnimBox->isChecked());
onDegeneration(myDegBox->isChecked());
myAutoApply = Auto;
}
void ViewDlg::onCancel()
{
hide();
}
void ViewDlg::onHelp()
{
}
void ViewDlg::onZBuffer( bool on )
{
QWidgetList aWidgetList;
Handle(V3d_View) aView;
QWidget* aWidget;
if (!myApplyAllViews)
aWidgetList.append(Application::getApplication()->getActiveMDI());
else
aWidgetList = Application::getWorkspace()->windowList();
if ( myAutoApply ){
foreach(aWidget, aWidgetList){
if ( !aWidget ) continue;
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
aView = aMDIWindow->getView();
if ( on )
aView->SetVisualization( V3d_ZBUFFER );
else
aView->SetVisualization( V3d_WIREFRAME );
}
}
}
void ViewDlg::onAnimation( bool on )
{
QWidgetList aWidgetList;
Handle(V3d_View) aView;
myIsAnim = on;
myDegBox->setEnabled( myIsAnim );
if (!myIsAnim) myDegBox->setChecked(false);
if (!myApplyAllViews)
aWidgetList.append(Application::getApplication()->getActiveMDI());
else
aWidgetList = Application::getWorkspace()->windowList();
if ( myAutoApply ){
QWidget* aWidget;
foreach(aWidget, aWidgetList){
if ( !aWidget ) continue;
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
aView = aMDIWindow->getView();
aView->SetAnimationMode( myIsAnim, myIsDeg );
aView->Redraw();
aView->SetImmediateUpdate(true);
aView->Update();
}
}
}
void ViewDlg::onDegeneration( bool on )
{
QWidgetList aWidgetList;
Handle(V3d_View) aView;
QWidget* aWidget;
if (!myApplyAllViews)
aWidgetList.append(Application::getApplication()->getActiveMDI());
else
aWidgetList = Application::getWorkspace()->windowList();
myIsDeg = on;
if ( myAutoApply ){
foreach(aWidget, aWidgetList){
if ( !aWidget ) continue;
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
aView = aMDIWindow->getView();
aView->SetAnimationMode( myIsAnim, myIsDeg );
}
}
}
void ViewDlg::onAutoApply( bool on )
{
myAutoApply = on;
}
void ViewDlg::onApplyAllViews( bool on )
{
myApplyAllViews = on;
}
void ViewDlg::Update()
{
MDIWindow* anActiveMDIWindow = Application::getApplication()->getActiveMDI();
if (anActiveMDIWindow){
Handle(V3d_View) aView = anActiveMDIWindow->getView();
if(!aView.IsNull()){
myIsAnim = aView->AnimationMode( myIsDeg );
myAnimBox->blockSignals( true );
myDegBox->blockSignals( true );
myAnimBox->setChecked( myIsAnim );
myDegBox->setChecked( myIsDeg );
myDegBox->setEnabled( myIsAnim );
myAnimBox->blockSignals( false );
myDegBox->blockSignals( false );
myZBufferBox->blockSignals(true);
V3d_TypeOfVisualization aVisuType = aView->Visualization();
if(aVisuType == V3d_WIREFRAME)
myZBufferBox -> setChecked(false);
else
myZBufferBox -> setChecked(true);
myZBufferBox->blockSignals(false);
}
}
}

View File

@ -1,328 +0,0 @@
#include "ViewOperations.h"
#include "global.h"
//#include "Material.h"
//#include "Transparency.h"
#include "Application.h"
#include "Document.h"
#include <qcolordialog.h>
#include <qapplication.h>
#include <qsignalmapper.h>
#include <qworkspace.h>
#include <qpixmap.h>
#include <qcursor.h>
#include <qaction.h>
#include <V3d_TypeOfView.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Quantity_Color.hxx>
static QCursor* defCursor = NULL;
static QCursor* handCursor = NULL;
static QCursor* panCursor = NULL;
static QCursor* zoomCursor = NULL;
static QCursor* rotCursor = NULL;
ViewOperations::ViewOperations( QObject* parent)
: QObject( parent )
{
myContext = NULL;
}
ViewOperations::ViewOperations( Handle(AIS_InteractiveContext) theContext,
QObject* parent)
: QObject( parent )
{
myContext = theContext;
initActions();
initViewActions();
}
ViewOperations::~ViewOperations()
{
myContext = NULL;
}
void ViewOperations::onWireframe()
{
AIS_ListOfInteractive displayed;
myContext->DisplayedObjects( displayed );
AIS_ListIteratorOfListOfInteractive it( displayed );
for ( ; it.More(); it.Next() )
myContext->SetDisplayMode( it.Value(), 0 );
#ifdef a
for(myContext->InitCurrent();myContext->MoreCurrent();myContext->NextCurrent())
myContext->SetDisplayMode(myContext->Current(),0);
#endif
}
void ViewOperations::onShading()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
AIS_ListOfInteractive displayed;
myContext->DisplayedObjects( displayed );
AIS_ListIteratorOfListOfInteractive it( displayed );
for ( ; it.More(); it.Next() )
myContext->SetDisplayMode( it.Value(), 1 );
#ifdef a
for(myContext->InitCurrent();myContext->MoreCurrent();myContext->NextCurrent())
myContext->SetDisplayMode(myContext->Current(),1);
#endif
QApplication::restoreOverrideCursor();
}
void ViewOperations::initActions()
{
initCursors();
initToolActions();
}
void ViewOperations::initCursors()
{
if( !defCursor )
defCursor = new QCursor( Qt::ArrowCursor );
if( !handCursor )
handCursor = new QCursor( Qt::PointingHandCursor );
if( !panCursor )
panCursor = new QCursor( Qt::SizeAllCursor );
QString dir( Application::getResourceDir() );
if( !zoomCursor )
zoomCursor = new QCursor( QPixmap( dir + tr( "ICON_CURSOR_ZOOM" ) ) );
if( !rotCursor )
rotCursor = new QCursor( QPixmap( dir + tr( "ICON_CURSOR_ROTATE" ) ) );
}
QList<QAction*> ViewOperations::getViewActions()
{
return myViewActions;
}
void ViewOperations::initViewActions()
{
if ( myViewActions.count() )
return;
QString dir = Application::getResourceDir();
QAction* a;
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITALL" ) ), "", this );
a->setToolTip( tr( "TBR_FITALL" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewFitAllId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITAREA" ) ), "", this );
a->setToolTip( tr( "TBR_FITAREA" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
myViewActions.insert( ViewFitAreaId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ZOOM" ) ), "", this );
a->setToolTip( tr( "TBR_ZOOM" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
myViewActions.insert( ViewZoomId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_PAN" ) ), "", this );
a->setToolTip( tr( "TBR_PAN" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
myViewActions.insert( ViewPanId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_GLOBALPAN" ) ), "", this );
a->setToolTip( tr( "TBR_GLOBALPAN" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
myViewActions.insert( ViewGlobalPanId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FRONT" ) ), "", this );
a->setToolTip( tr( "TBR_FRONT" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewFrontId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BACK" ) ), "", this );
a->setToolTip( tr( "TBR_BACK" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewBackId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_TOP" ) ), "", this );
a->setToolTip( tr( "TBR_TOP" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewTopId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BOTTOM" ) ), "", this );
a->setToolTip( tr( "TBR_BOTTOM" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewBottomId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_LEFT" ) ), "", this );
a->setToolTip( tr( "TBR_LEFT" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewLeftId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RIGHT" ) ), "", this );
a->setToolTip( tr( "TBR_RIGHT" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewRightId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_AXO" ) ), "", this );
a->setToolTip( tr( "TBR_AXO" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewAxoId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ROTATION" ) ), "", this );
a->setToolTip( tr( "TBR_ROTATION" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
myViewActions.insert( ViewRotationId, a );
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RESET" ) ), "", this );
a->setToolTip( tr( "TBR_RESET" ) );
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
myViewActions.insert( ViewResetId, a );
}
void ViewOperations::updateToggled( bool isOn )
{
if( !isOn )
return;
QAction* sentBy = (QAction*) sender();
for ( int i = ViewFitAllId;i <= ViewResetId ; i++)
{
QAction* anAction = myViewActions.at(i);
if( (anAction == myViewActions.at(ViewFitAreaId)) ||
(anAction == myViewActions.at(ViewZoomId)) ||
(anAction == myViewActions.at(ViewPanId)) ||
(anAction == myViewActions.at(ViewGlobalPanId)) ||
(anAction == myViewActions.at(ViewRotationId))) {
if (anAction && (anAction != sentBy)) {
anAction->setCheckable(true);
anAction->setChecked(false);
} else {
if(sentBy == myViewActions.at(ViewFitAreaId))
emit setCursor(*handCursor);
else if (sentBy == myViewActions.at(ViewZoomId))
emit setCursor(*zoomCursor);
else if (sentBy == myViewActions.at(ViewPanId))
emit setCursor(*panCursor);
else if (sentBy == myViewActions.at(ViewGlobalPanId))
emit setCursor(*defCursor);
else if (sentBy == myViewActions.at(ViewRotationId))
emit setCursor(*rotCursor);
sentBy->setCheckable(false);
}
}
}
}
QList<QAction*> ViewOperations::getToolActions()
{
initToolActions();
return myToolActions;
}
void ViewOperations::initToolActions()
{
if( myToolActions.count() )
return;
QString dir = Application::getResourceDir();
//QAction* a = new QAction( tr( "TBR_TOOL_MAGVIEW" ), QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ),
// "", 0, this );
//verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
//myToolActions->insert( MagViewId, a );
// QAction* a = new QAction( tr( "TBR_TOOL_AXOVIEW" ), QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ),
// "", 0, this );
// verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
// myToolActions->insert( AxoViewId, a );
// a = new QAction( tr( "TBR_TOOL_PERVIEW" ), QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ),
// "", 0, this );
// verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
// myToolActions->insert( PerViewId, a );
QAction* a = new QAction( QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ), "", this );
a->setToolTip( tr( "TBR_TOOL_WIRE" ) );
a->setCheckable( true );
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
myToolActions.insert( ToolWireframeId, a );
a = new QAction( QPixmap( dir + tr( "ICON_TOOL_SHAD") ), "", this );
a->setToolTip( tr( "TBR_TOOL_SHAD" ) );
a->setCheckable( true );
a->setChecked( true );
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
myToolActions.insert( ToolShadingId, a );
}
void ViewOperations::onToolAction()
{
QAction* sentBy = (QAction*) sender();
//MDIWindow* win = (MDIWindow*) Application::getWorkspace()->activeWindow();
MDIWindow* win = (MDIWindow*)Application::getApplication()->getActiveMDI();
Document* doc = win->getDocument();
// if( sentBy == myToolActions->at( MagViewId ) )
// win->defineMagView();
// if( sentBy == myToolActions->at( PerViewId ) )
// doc->createNewView( V3d_PERSPECTIVE );
// if( sentBy == myToolActions->at( AxoViewId ) )
// doc->createNewView();
if( sentBy == myToolActions.at( ToolWireframeId ) )
doc->onWireframe();
if( sentBy == myToolActions.at( ToolShadingId ) )
doc->onShading();
}
int ViewOperations::getDisplayMode()
{
bool on = myToolActions.at( ToolWireframeId )->isChecked();
return on ? 0 : 1;
}
void ViewOperations::onNoActiveActions()
{
for ( int i = ViewFitAllId;i <= ViewResetId ; i++ ) {
QAction* anAction = myViewActions.at( i );
if( ( anAction == myViewActions.at( ViewFitAreaId ) ) ||
( anAction == myViewActions.at( ViewZoomId ) ) ||
( anAction == myViewActions.at( ViewPanId ) ) ||
( anAction == myViewActions.at( ViewGlobalPanId ) ) ||
( anAction == myViewActions.at( ViewRotationId ) ) ) {
emit setCursor( *defCursor );
anAction->setCheckable( true );
anAction->setChecked( false );
}
}
}
void ViewOperations::onActionActivated()
{
QAction* a = (QAction*) sender();
//MDIWindow* win = (MDIWindow*) Application::getWorkspace()->activeWindow();
MDIWindow* win = (MDIWindow*) Application::getApplication()->getActiveMDI();
int index = myViewActions.indexOf( a );
if ( index != -1 )
win->activateAction( (Action)index );
}