mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-03-30 17:16:22 +03:00
Documentation - Migration to CMake from TCL #441
Remove OS folder with structure for refman generation. Remove tcl scripts from adm folder which used only for doc generation Migrate all the processes of doc generation to cmake (adm/cmake/occt_doc.cmake) RefMan and Overview build from CMake as a new utility option, no TCL is needed.
This commit is contained in:
parent
df4b931988
commit
606d652b41
62
.github/actions/build-docs/action.yml
vendored
62
.github/actions/build-docs/action.yml
vendored
@ -10,37 +10,59 @@ runs:
|
||||
choco install -y doxygen.install
|
||||
shell: pwsh
|
||||
|
||||
- name: Build refman documentation
|
||||
- name: Download and extract 3rdparty dependencies
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd adm
|
||||
bash gendoc -refman
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure OCCT
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -T host=x64 `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_TK=OFF `
|
||||
-D BUILD_USE_PCH=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D CMAKE_BUILD_TYPE=Release `
|
||||
-D BUILD_DOC_Overview=ON `
|
||||
-D BUILD_DOC_RefMan=ON `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D USE_D3D=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=ON `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D CMAKE_CXX_FLAGS="/W4 /WX" `
|
||||
-D CMAKE_C_FLAGS="/W4 /WX" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build documentation
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd build
|
||||
cmake --build . --target doc --config Release
|
||||
shell: cmd
|
||||
|
||||
- name: Upload refman documentation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: refman-doc
|
||||
path: doc/refman
|
||||
path: build/doc/refman
|
||||
retention-days: 90
|
||||
|
||||
- name: Upload generation log
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: doxygen.log
|
||||
path: doc/html_doxygen_err.log
|
||||
retention-days: 90
|
||||
|
||||
- name: Build documentation Overview
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd adm
|
||||
bash gendoc -overview
|
||||
shell: cmd
|
||||
|
||||
- name: Upload overview documentation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: overview-doc
|
||||
path: doc/overview
|
||||
path: build/doc/overview
|
||||
retention-days: 90
|
||||
|
@ -225,6 +225,15 @@ if (NOT DEFINED BUILD_DOC_Overview)
|
||||
set (BUILD_DOC_Overview OFF CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
|
||||
endif()
|
||||
|
||||
# Reference Manual
|
||||
if (NOT DEFINED BUILD_DOC_RefMan)
|
||||
set (BUILD_DOC_RefMan OFF CACHE BOOL "${BUILD_DOC_RefMan_DESCR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_DOC_RefMan)
|
||||
set (INSTALL_DOC_RefMan OFF CACHE BOOL "${INSTALL_DOC_RefMan_DESCR}")
|
||||
endif()
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.14")
|
||||
OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK)
|
||||
endif()
|
||||
@ -702,7 +711,7 @@ else()
|
||||
endif()
|
||||
|
||||
# Doxygen
|
||||
if (BUILD_DOC_Overview)
|
||||
if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)
|
||||
if (NOT DEFINED INSTALL_DOC_Overview)
|
||||
set (INSTALL_DOC_Overview OFF CACHE BOOL "${INSTALL_DOC_Overview_DESCR}")
|
||||
endif()
|
||||
@ -710,7 +719,7 @@ if (BUILD_DOC_Overview)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/doxygen")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_DOC_Overview")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_DOC_RefMan")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
|
||||
endif()
|
||||
@ -1175,7 +1184,9 @@ foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
||||
endforeach()
|
||||
|
||||
if (BUILD_DOC_Overview)
|
||||
OCCT_ADD_SUBDIRECTORY (dox)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_doc")
|
||||
# Setup documentation targets
|
||||
OCCT_SETUP_DOC_TARGETS()
|
||||
endif()
|
||||
|
||||
# patch DRAWEXE
|
||||
|
475
adm/UDLIST
475
adm/UDLIST
@ -1,475 +0,0 @@
|
||||
n NCollection
|
||||
n BSplCLib
|
||||
n BSplSLib
|
||||
n Bnd
|
||||
n BVH
|
||||
n CSLib
|
||||
n Convert
|
||||
n ElCLib
|
||||
n ElSLib
|
||||
n Expr
|
||||
n ExprIntrp
|
||||
n FSD
|
||||
n GeomAbs
|
||||
n Message
|
||||
n OSD
|
||||
n PLib
|
||||
n Plugin
|
||||
n Poly
|
||||
n Precision
|
||||
n Quantity
|
||||
n Resource
|
||||
n Standard
|
||||
n StdFail
|
||||
n Storage
|
||||
n TColStd
|
||||
n TColgp
|
||||
n TCollection
|
||||
n TShort
|
||||
n TopLoc
|
||||
n Units
|
||||
n UnitsAPI
|
||||
n gp
|
||||
n math
|
||||
r OS
|
||||
n FlexLexer
|
||||
t TKMath
|
||||
t TKernel
|
||||
n Adaptor2d
|
||||
n Adaptor3d
|
||||
n AdvApp2Var
|
||||
n AdvApprox
|
||||
n AppCont
|
||||
n AppDef
|
||||
n AppParCurves
|
||||
n Approx
|
||||
n BRep
|
||||
n BRepAdaptor
|
||||
n BRepLProp
|
||||
n BRepTools
|
||||
n BndLib
|
||||
n CPnts
|
||||
n Extrema
|
||||
n FEmTool
|
||||
n GC
|
||||
n GCE2d
|
||||
n GCPnts
|
||||
n GProp
|
||||
n Geom
|
||||
n Geom2d
|
||||
n Geom2dAdaptor
|
||||
n Geom2dConvert
|
||||
n Geom2dLProp
|
||||
n GeomAdaptor
|
||||
n GeomConvert
|
||||
n GeomLProp
|
||||
n GeomLib
|
||||
n GeomProjLib
|
||||
n GeomTools
|
||||
n GeomEvaluator
|
||||
n Hermit
|
||||
n IntAna
|
||||
n IntAna2d
|
||||
n LProp
|
||||
n LProp3d
|
||||
n ProjLib
|
||||
n TColGeom
|
||||
n TColGeom2d
|
||||
n TopAbs
|
||||
n TopExp
|
||||
n TopTools
|
||||
n TopoDS
|
||||
n gce
|
||||
t TKBRep
|
||||
t TKG2d
|
||||
t TKG3d
|
||||
t TKGeomBase
|
||||
n AppBlend
|
||||
n ApproxInt
|
||||
n BOPTools
|
||||
n BRepAlgo
|
||||
n BRepAlgoAPI
|
||||
n BRepApprox
|
||||
n BRepBlend
|
||||
n BRepBndLib
|
||||
n BRepBuilderAPI
|
||||
n BRepCheck
|
||||
n BRepClass
|
||||
n BRepClass3d
|
||||
n BRepExtrema
|
||||
n BRepFeat
|
||||
n BRepFill
|
||||
n BRepFilletAPI
|
||||
n BRepGProp
|
||||
n BRepIntCurveSurface
|
||||
n BRepLib
|
||||
n BRepMAT2d
|
||||
n BRepMesh
|
||||
n BRepMeshData
|
||||
n BRepOffset
|
||||
n BRepOffsetAPI
|
||||
n BRepPreviewAPI
|
||||
n BRepPrim
|
||||
n BRepPrimAPI
|
||||
n BRepProj
|
||||
n BRepSweep
|
||||
n BRepTopAdaptor
|
||||
n BiTgte
|
||||
n Bisector
|
||||
n Blend
|
||||
n BlendFunc
|
||||
n ChFi2d
|
||||
n ChFi3d
|
||||
n ChFiDS
|
||||
n ChFiKPart
|
||||
n Contap
|
||||
n Draft
|
||||
n FairCurve
|
||||
n FilletSurf
|
||||
n GccAna
|
||||
n GccEnt
|
||||
n GccInt
|
||||
n Geom2dAPI
|
||||
n Geom2dGcc
|
||||
n Geom2dHatch
|
||||
n Geom2dInt
|
||||
n GeomAPI
|
||||
n GeomFill
|
||||
n GeomInt
|
||||
n GeomPlate
|
||||
n HLRAlgo
|
||||
n HLRBRep
|
||||
n HLRTopoBRep
|
||||
n HLRAppli
|
||||
n Hatch
|
||||
n HatchGen
|
||||
n IMeshData
|
||||
n IMeshTools
|
||||
n IntCurve
|
||||
n IntCurveSurface
|
||||
n IntCurvesFace
|
||||
n IntImp
|
||||
n IntImpParGen
|
||||
n IntPatch
|
||||
n IntPolyh
|
||||
n IntRes2d
|
||||
n IntStart
|
||||
n IntSurf
|
||||
n IntTools
|
||||
n IntWalk
|
||||
n Intf
|
||||
n Intrv
|
||||
n Law
|
||||
n LocOpe
|
||||
n LocalAnalysis
|
||||
n MAT
|
||||
n MAT2d
|
||||
n NLPlate
|
||||
n Plate
|
||||
n ShapeAlgo
|
||||
n ShapeAnalysis
|
||||
n ShapeBuild
|
||||
n ShapeConstruct
|
||||
n ShapeCustom
|
||||
n ShapeExtend
|
||||
n ShapeFix
|
||||
n ShapeProcess
|
||||
n ShapeProcessAPI
|
||||
n ShapeUpgrade
|
||||
n Sweep
|
||||
n TopBas
|
||||
n TopClass
|
||||
n TopCnx
|
||||
n TopOpeBRep
|
||||
n TopOpeBRepBuild
|
||||
n TopOpeBRepDS
|
||||
n TopOpeBRepTool
|
||||
n TopTrans
|
||||
n XBRepMesh
|
||||
t TKBO
|
||||
t TKBool
|
||||
t TKFeat
|
||||
t TKFillet
|
||||
t TKGeomAlgo
|
||||
t TKHLR
|
||||
t TKMesh
|
||||
t TKOffset
|
||||
t TKPrim
|
||||
t TKShHealing
|
||||
t TKTopAlgo
|
||||
t TKXMesh
|
||||
n AIS
|
||||
n Aspect
|
||||
n DsgPrs
|
||||
n PrsDim
|
||||
n Graphic3d
|
||||
n Image
|
||||
n Media
|
||||
n MeshVS
|
||||
n OpenGl
|
||||
n OpenGles
|
||||
n D3DHost
|
||||
n Prs3d
|
||||
n PrsMgr
|
||||
n Select3D
|
||||
n SelectBasics
|
||||
n SelectMgr
|
||||
n StdPrs
|
||||
n StdSelect
|
||||
n V3d
|
||||
n Wasm
|
||||
n WNT
|
||||
n Xw
|
||||
n Cocoa
|
||||
r Textures
|
||||
r Shaders
|
||||
r XRResources
|
||||
t TKMeshVS
|
||||
t TKOpenGl
|
||||
t TKOpenGles
|
||||
t TKD3DHost
|
||||
t TKService
|
||||
t TKV3d
|
||||
n BinTObjDrivers
|
||||
n LDOM
|
||||
n TObj
|
||||
n XmlTObjDrivers
|
||||
n AppStd
|
||||
n AppStdL
|
||||
n BinDrivers
|
||||
n BinLDrivers
|
||||
n BinMDF
|
||||
n BinMDataStd
|
||||
n BinMDataXtd
|
||||
n BinMDocStd
|
||||
n BinMFunction
|
||||
n BinMNaming
|
||||
n BinObjMgt
|
||||
n BinTools
|
||||
n CDF
|
||||
n CDM
|
||||
n PCDM
|
||||
n StdLDrivers
|
||||
n StdLPersistent
|
||||
n StdObjMgt
|
||||
n StdDrivers
|
||||
n StdObject
|
||||
n StdPersistent
|
||||
n StdStorage
|
||||
n ShapePersistent
|
||||
n TDF
|
||||
n TDataStd
|
||||
n TDataXtd
|
||||
n TDocStd
|
||||
n TFunction
|
||||
n TNaming
|
||||
n TPrsStd
|
||||
n UTL
|
||||
n XmlDrivers
|
||||
n XmlLDrivers
|
||||
n XmlMDF
|
||||
n XmlMDataStd
|
||||
n XmlMDataXtd
|
||||
n XmlMDocStd
|
||||
n XmlMFunction
|
||||
n XmlMNaming
|
||||
n XmlObjMgt
|
||||
r StdResource
|
||||
r XmlOcafResource
|
||||
|
||||
t TKBin
|
||||
t TKBinL
|
||||
t TKBinTObj
|
||||
t TKCAF
|
||||
t TKCDF
|
||||
t TKLCAF
|
||||
|
||||
t TKStdL
|
||||
t TKStd
|
||||
t TKTObj
|
||||
t TKXml
|
||||
t TKXmlL
|
||||
t TKXmlTObj
|
||||
n IGESFile
|
||||
n StepFile
|
||||
n APIHeaderSection
|
||||
n BRepToIGES
|
||||
n BRepToIGESBRep
|
||||
n BinMXCAFDoc
|
||||
n BinXCAFDrivers
|
||||
n Geom2dToIGES
|
||||
n GeomToIGES
|
||||
n GeomToStep
|
||||
n HeaderSection
|
||||
n IFGraph
|
||||
n IFSelect
|
||||
n IGESAppli
|
||||
n IGESBasic
|
||||
n IGESCAFControl
|
||||
n IGESControl
|
||||
n IGESConvGeom
|
||||
n IGESData
|
||||
n IGESDefs
|
||||
n IGESDimen
|
||||
n IGESDraw
|
||||
n IGESGeom
|
||||
n IGESGraph
|
||||
n IGESSelect
|
||||
n IGESSolid
|
||||
n IGESToBRep
|
||||
n Interface
|
||||
n LibCtl
|
||||
n MoniTool
|
||||
n RWHeaderSection
|
||||
n RWStepAP203
|
||||
n RWStepAP214
|
||||
n RWStepAP242
|
||||
n RWStepBasic
|
||||
n RWStepDimTol
|
||||
n RWStepElement
|
||||
n RWStepFEA
|
||||
n RWStepGeom
|
||||
n RWStepKinematics
|
||||
n RWStepRepr
|
||||
n RWStepShape
|
||||
n RWStepVisual
|
||||
n RWStl
|
||||
n STEPCAFControl
|
||||
n STEPConstruct
|
||||
n STEPControl
|
||||
n STEPEdit
|
||||
n STEPSelections
|
||||
n StepAP203
|
||||
n StepAP209
|
||||
n StepAP214
|
||||
n StepAP242
|
||||
n StepBasic
|
||||
n StepData
|
||||
n StepDimTol
|
||||
n StepElement
|
||||
n StepFEA
|
||||
n StepGeom
|
||||
n StepKinematics
|
||||
n StepRepr
|
||||
n StepSelect
|
||||
n StepShape
|
||||
n StepToGeom
|
||||
n StepToTopoDS
|
||||
n StepVisual
|
||||
n StlAPI
|
||||
n TopoDSToStep
|
||||
n Transfer
|
||||
n TransferBRep
|
||||
n UnitsMethods
|
||||
n Vrml
|
||||
n VrmlAPI
|
||||
n VrmlConverter
|
||||
n VrmlData
|
||||
n XCAFApp
|
||||
n XCAFDimTolObjects
|
||||
n XCAFDoc
|
||||
n XCAFPrs
|
||||
n XSAlgo
|
||||
n XSControl
|
||||
n XmlMXCAFDoc
|
||||
n XmlXCAFDrivers
|
||||
r SHMessage
|
||||
r XSMessage
|
||||
r XSTEPResource
|
||||
t TKBinXCAF
|
||||
t TKDESTL
|
||||
t TKDEVRML
|
||||
t TKXCAF
|
||||
t TKDE
|
||||
t TKDECascade
|
||||
t TKDEIGES
|
||||
t TKDESTEP
|
||||
t TKXSBase
|
||||
t TKXmlXCAF
|
||||
n BOPTest
|
||||
n BRepTest
|
||||
n DBRep
|
||||
n DDF
|
||||
n DDataStd
|
||||
n DDocStd
|
||||
n DE
|
||||
n DEXCAFCascade
|
||||
n DEBRepCascade
|
||||
n DNaming
|
||||
n DPrsStd
|
||||
n Draw
|
||||
n DrawDim
|
||||
n DrawFairCurve
|
||||
n DrawTrSurf
|
||||
n GeometryTest
|
||||
n GeomliteTest
|
||||
n HLRTest
|
||||
n MeshTest
|
||||
n SWDRAW
|
||||
n TObjDRAW
|
||||
n OpenGlTest
|
||||
n OpenGlesTest
|
||||
n D3DHostTest
|
||||
n ViewerTest
|
||||
n XDEDRAW
|
||||
n XSDRAW
|
||||
n XSDRAWIGES
|
||||
n XSDRAWSTEP
|
||||
n XSDRAWSTL
|
||||
n XSDRAWVRML
|
||||
n XSDRAWDE
|
||||
n XSDRAWGLTF
|
||||
n XSDRAWOBJ
|
||||
n XSDRAWPLY
|
||||
r DrawResources
|
||||
t TKDCAF
|
||||
t TKDraw
|
||||
t TKTObjDRAW
|
||||
t TKTopTest
|
||||
t TKOpenGlTest
|
||||
t TKOpenGlesTest
|
||||
t TKD3DHostTest
|
||||
t TKViewerTest
|
||||
t TKXDEDRAW
|
||||
t TKXSDRAW
|
||||
t TKXSDRAWIGES
|
||||
t TKXSDRAWSTEP
|
||||
t TKXSDRAWSTL
|
||||
t TKXSDRAWVRML
|
||||
t TKXSDRAWDE
|
||||
t TKXSDRAWGLTF
|
||||
t TKXSDRAWOBJ
|
||||
t TKXSDRAWPLY
|
||||
x DRAWEXE
|
||||
n QADraw
|
||||
n QANCollection
|
||||
n QANewBRepNaming
|
||||
n QANewDBRepNaming
|
||||
n QANewModTopOpe
|
||||
t TKQADraw
|
||||
n QADNaming
|
||||
n QABugs
|
||||
n Font
|
||||
n BOPAlgo
|
||||
n BOPDS
|
||||
n BOPCol
|
||||
n IVtk
|
||||
n IVtkOCC
|
||||
n IVtkVTK
|
||||
n IVtkTools
|
||||
t TKIVtk
|
||||
n IVtkDraw
|
||||
t TKIVtkDraw
|
||||
n Geom2dEvaluator
|
||||
t TKVCAF
|
||||
n XCAFView
|
||||
n XCAFNoteObjects
|
||||
t TKRWMesh
|
||||
t TKDEGLTF
|
||||
t TKDEOBJ
|
||||
t TKDEPLY
|
||||
n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n RWPly
|
||||
t TKExpress
|
655
adm/cmake/occt_doc.cmake
Normal file
655
adm/cmake/occt_doc.cmake
Normal file
@ -0,0 +1,655 @@
|
||||
##
|
||||
|
||||
# Function to collect modules, toolkits, and packages information for documentation
|
||||
function(OCCT_DOC_COLLECT_MODULES_INFO)
|
||||
# Set output variables in parent scope
|
||||
set(OCCT_MODULES ${OCCT_MODULES} PARENT_SCOPE)
|
||||
|
||||
# For each module, collect its toolkits
|
||||
foreach(OCCT_MODULE ${OCCT_MODULES})
|
||||
if(NOT "${OCCT_MODULE}" STREQUAL "")
|
||||
set(MODULES_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
|
||||
set(TOOLKITS_IN_MODULE_${OCCT_MODULE} ${MODULES_TOOLKITS} PARENT_SCOPE)
|
||||
|
||||
# For each toolkit, collect its packages
|
||||
foreach(TOOLKIT ${MODULES_TOOLKITS})
|
||||
set(TOOLKIT_PARENT_MODULE_${TOOLKIT} ${OCCT_MODULE} PARENT_SCOPE)
|
||||
|
||||
# Get packages from toolkit
|
||||
set(TOOLKIT_PACKAGES "")
|
||||
EXTRACT_TOOLKIT_PACKAGES("src" ${TOOLKIT} TOOLKIT_PACKAGES)
|
||||
set(PACKAGES_IN_TOOLKIT_${TOOLKIT} ${TOOLKIT_PACKAGES} PARENT_SCOPE)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Function to generate module dependency graph
|
||||
function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for module dependencies
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
file(APPEND ${DOT_FILE} "\t${MODULE} [ URL = \"module_${MODULE}.html\" ]\n")
|
||||
|
||||
# Add dependencies between modules
|
||||
foreach(MODULE_TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
|
||||
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
||||
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate toolkit dependency graph for a module
|
||||
function(OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME MODULE_NAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for toolkit dependencies within a module
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE_NAME}})
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT} [ URL = \"toolkit_${TOOLKIT}.html\" ]\n")
|
||||
|
||||
# Add dependencies between toolkits in the same module
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT}})
|
||||
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
||||
"${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE_NAME}")
|
||||
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} -> ${TOOLKIT} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate dependency graph for a specific toolkit
|
||||
function(OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME TOOLKIT_NAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for dependencies of a single toolkit
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} [ URL = \"toolkit_${TOOLKIT_NAME}.html\", shape = box ]\n")
|
||||
|
||||
# Add toolkit dependencies
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT_NAME}})
|
||||
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} [ URL = \"toolkit_${DEPENDENT_TOOLKIT}.html\", shape = box ]\n")
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} -> ${DEPENDENT_TOOLKIT} [ color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endforeach()
|
||||
|
||||
if(TOOLKIT_DEPENDENCY_${TOOLKIT_NAME})
|
||||
list(LENGTH TOOLKIT_DEPENDENCY_${TOOLKIT_NAME} DEPS_COUNT)
|
||||
if(DEPS_COUNT GREATER 1)
|
||||
file(APPEND ${DOT_FILE} "\taspect = 1\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate main page for documentation
|
||||
function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
|
||||
set(MAIN_PAGE_FILE "${OUTPUT_DIR}/${OUTPUT_FILE}")
|
||||
file(WRITE ${MAIN_PAGE_FILE} "/**\n")
|
||||
|
||||
# Check if we're generating documentation for a single module
|
||||
if(DOC_SINGLE_MODULE)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${DOC_SINGLE_MODULE}\n")
|
||||
else()
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage Open CASCADE Technology Reference Manual\n\n")
|
||||
# List all modules
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage module_${MODULE}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
# Add modules relationship diagram
|
||||
OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_all_modules")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_all_modules.dot\n")
|
||||
endif()
|
||||
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
|
||||
# Generate pages for modules and their toolkits
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
|
||||
if(DOC_SINGLE_MODULE)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${MODULE}\n")
|
||||
else()
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page module_${MODULE} Module ${MODULE}\n")
|
||||
endif()
|
||||
|
||||
# List toolkits in the module
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT}\n")
|
||||
endforeach()
|
||||
|
||||
# Add module diagram
|
||||
OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${MODULE}" ${MODULE})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${MODULE}.dot\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Generate pages for toolkits and their packages
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page toolkit_${TOOLKIT} Toolkit ${TOOLKIT}\n")
|
||||
|
||||
# List packages in toolkit
|
||||
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
||||
set(PACKAGE_NAME ${PACKAGE})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME}\n")
|
||||
endforeach()
|
||||
|
||||
# Add toolkit dependencies diagram
|
||||
OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${TOOLKIT}" ${TOOLKIT})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${TOOLKIT}.dot\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Generate pages for packages and their classes
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page package_${PACKAGE} Package ${PACKAGE}\n")
|
||||
|
||||
# Find header files in the package
|
||||
file(GLOB PACKAGE_HEADERS "${CMAKE_SOURCE_DIR}/src/${PACKAGE}/*.hxx")
|
||||
foreach(HEADER ${PACKAGE_HEADERS})
|
||||
get_filename_component(HEADER_NAME ${HEADER} NAME_WE)
|
||||
if(NOT HEADER_NAME MATCHES "^Handle_" AND NOT HEADER_NAME MATCHES "^Standard$")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage ${HEADER_NAME}\n")
|
||||
# Append header file to DOXYGEN_INPUT_FILES list
|
||||
list(APPEND DOXYGEN_INPUT_FILES "${HEADER}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Create a variable containing all input files for Doxygen
|
||||
string(REPLACE ";" " " DOXYGEN_INPUT_FILES_STRING "${DOXYGEN_INPUT_FILES}")
|
||||
set(DOXYGEN_INPUT_FILES_STRING ${DOXYGEN_INPUT_FILES_STRING} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to extract dependency information for toolkits
|
||||
function(OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES)
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
EXTRACT_TOOLKIT_EXTERNLIB("src" ${TOOLKIT} EXTERNLIB_LIST)
|
||||
|
||||
set(DEPENDENT_TOOLKITS "")
|
||||
foreach(EXTERNLIB ${EXTERNLIB_LIST})
|
||||
if(EXTERNLIB MATCHES "^TK")
|
||||
list(APPEND DEPENDENT_TOOLKITS ${EXTERNLIB})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(TOOLKIT_DEPENDENCY_${TOOLKIT} ${DEPENDENT_TOOLKITS} PARENT_SCOPE)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Function to load file lists for documentation
|
||||
function(OCCT_DOC_LOAD_FILE_LISTS)
|
||||
# Load list of HTML documentation files
|
||||
set(FILES_HTML_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_HTML.txt")
|
||||
if(EXISTS ${FILES_HTML_PATH})
|
||||
file(STRINGS ${FILES_HTML_PATH} HTML_FILES REGEX "^[^#]+")
|
||||
set(OCCT_DOC_HTML_FILES ${HTML_FILES} PARENT_SCOPE)
|
||||
else()
|
||||
set(OCCT_DOC_HTML_FILES "" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Load list of PDF documentation files
|
||||
set(FILES_PDF_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_PDF.txt")
|
||||
if(EXISTS ${FILES_PDF_PATH})
|
||||
file(STRINGS ${FILES_PDF_PATH} PDF_FILES REGEX "^[^#]+")
|
||||
set(OCCT_DOC_PDF_FILES ${PDF_FILES} PARENT_SCOPE)
|
||||
else()
|
||||
set(OCCT_DOC_PDF_FILES "" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Function to collect image directories from input files
|
||||
function(OCCT_DOC_COLLECT_IMAGE_DIRS INPUT_DIRS RESULT_IMAGE_DIRS)
|
||||
set(IMAGE_DIRS "")
|
||||
|
||||
foreach(INPUT_DIR ${INPUT_DIRS})
|
||||
# Check if directory exists
|
||||
if(EXISTS "${INPUT_DIR}")
|
||||
# Add the standard "images" subdirectory if it exists
|
||||
if(EXISTS "${INPUT_DIR}/images")
|
||||
list(APPEND IMAGE_DIRS "${INPUT_DIR}/images")
|
||||
endif()
|
||||
|
||||
# Find all subdirectories containing images
|
||||
file(GLOB_RECURSE IMAGE_FILES
|
||||
"${INPUT_DIR}/*.png"
|
||||
"${INPUT_DIR}/*.jpg"
|
||||
"${INPUT_DIR}/*.jpeg"
|
||||
"${INPUT_DIR}/*.gif"
|
||||
"${INPUT_DIR}/*.svg")
|
||||
|
||||
foreach(IMAGE_FILE ${IMAGE_FILES})
|
||||
get_filename_component(IMAGE_DIR ${IMAGE_FILE} DIRECTORY)
|
||||
list(APPEND IMAGE_DIRS "${IMAGE_DIR}")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(IMAGE_DIRS)
|
||||
list(REMOVE_DUPLICATES IMAGE_DIRS)
|
||||
endif()
|
||||
|
||||
set(${RESULT_IMAGE_DIRS} ${IMAGE_DIRS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to configure and run Doxygen for documentation generation
|
||||
function(OCCT_DOC_CONFIGURE_DOXYGEN OUTPUT_DIR CONFIG_FILE DOC_TYPE)
|
||||
# Create output directory if it doesn't exist
|
||||
file(MAKE_DIRECTORY ${OUTPUT_DIR})
|
||||
|
||||
# Use existing Doxygen template file as base
|
||||
if(DOC_TYPE STREQUAL "OVERVIEW")
|
||||
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_ug_html.doxyfile")
|
||||
else()
|
||||
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_rm.doxyfile")
|
||||
endif()
|
||||
|
||||
# Define Doxygen parameters that need to be overridden from the template
|
||||
set(DOXYGEN_CONFIG_FILE "${OUTPUT_DIR}/${CONFIG_FILE}")
|
||||
|
||||
# Check if template file exists
|
||||
if(NOT EXISTS ${TEMPLATE_DOXYFILE})
|
||||
message(FATAL_ERROR "ERROR: Doxygen template file not found: ${TEMPLATE_DOXYFILE}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Read template content
|
||||
file(READ ${TEMPLATE_DOXYFILE} DOXYGEN_TEMPLATE_CONTENT)
|
||||
|
||||
# Create the output Doxyfile
|
||||
file(WRITE ${DOXYGEN_CONFIG_FILE} "# Doxyfile generated by OCCT_DOC_CONFIGURE_DOXYGEN\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Base template: ${TEMPLATE_DOXYFILE}\n\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "${DOXYGEN_TEMPLATE_CONTENT}\n\n")
|
||||
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Custom overrides set by CMake:\n")
|
||||
|
||||
# Project information
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "OUTPUT_DIRECTORY = ${OUTPUT_DIR}\n")
|
||||
|
||||
# Ensure client-side search is configured correctly
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Search engine settings\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHENGINE = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SERVER_BASED_SEARCH = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTERNAL_SEARCH = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHDATA_FILE = searchdata.xml\n")
|
||||
|
||||
# Additional parameters based on the document type
|
||||
if(DOC_TYPE STREQUAL "OVERVIEW")
|
||||
# Settings for Overview documentation
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_ALL = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_STATIC = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */src/* */inc/* */drv/* */Properties/*\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "ENABLED_SECTIONS = OVERVIEW_SECTION\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt.tag\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TREEVIEW = YES\n")
|
||||
|
||||
# Setup tag file for cross-referencing with Reference Manual
|
||||
if(BUILD_DOC_RefMan)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Cross-referencing with Reference Manual\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "TAGFILES = \"${CMAKE_BINARY_DIR}/doc/refman/occt_refman.tag=../../refman/html\"\n")
|
||||
endif()
|
||||
|
||||
# Input files for overview
|
||||
if(DEFINED OCCT_OVERVIEW_FILES)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_OVERVIEW_FILES}\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/dox\n")
|
||||
endif()
|
||||
|
||||
# Collect image directories for overview
|
||||
set(OVERVIEW_INPUT_DIRS ${CMAKE_SOURCE_DIR}/dox)
|
||||
OCCT_DOC_COLLECT_IMAGE_DIRS("${OVERVIEW_INPUT_DIRS}" OVERVIEW_IMAGE_DIRS)
|
||||
|
||||
# Image path for overview
|
||||
if(OVERVIEW_IMAGE_DIRS)
|
||||
string(REPLACE ";" " " OVERVIEW_IMAGE_DIRS_STR "${OVERVIEW_IMAGE_DIRS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OVERVIEW_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
endif()
|
||||
|
||||
# Example paths
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/samples\n")
|
||||
else()
|
||||
# Settings for Reference Manual
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NAME = \"Open CASCADE Technology Reference Manual\"\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "BUILTIN_STL_SUPPORT = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PACKAGE = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */Properties/*\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "FILE_PATTERNS = *.h *.hxx *.lxx *.gxx *.pxx *.cxx *.cpp *.c *.md\n")
|
||||
|
||||
# Generate a tag file for cross-referencing from Overview
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Generate tag file for cross-referencing\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt_refman.tag\n")
|
||||
|
||||
# Input files for reference manual - CRITICAL FOR PROPER GENERATION
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Input files for reference manual\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/src\n")
|
||||
|
||||
# If generating documentation for specific modules
|
||||
if(DEFINED OCCT_DOC_MODULES)
|
||||
set(MODULE_PATHS "")
|
||||
foreach(MODULE ${OCCT_DOC_MODULES})
|
||||
foreach(TOOLKIT ${${MODULE}_TOOLKITS})
|
||||
list(APPEND MODULE_PATHS "${CMAKE_SOURCE_DIR}/src/${TOOLKIT}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
string(REPLACE ";" " " MODULE_PATHS_STR "${MODULE_PATHS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${MODULE_PATHS_STR}\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
|
||||
# Configure image path for reference manual
|
||||
set(REFMAN_INPUT_DIRS ${CMAKE_SOURCE_DIR}/src)
|
||||
OCCT_DOC_COLLECT_IMAGE_DIRS("${REFMAN_INPUT_DIRS}" REFMAN_IMAGE_DIRS)
|
||||
|
||||
if(REFMAN_IMAGE_DIRS)
|
||||
string(REPLACE ";" " " REFMAN_IMAGE_DIRS_STR "${REFMAN_IMAGE_DIRS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${REFMAN_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
endif()
|
||||
|
||||
# Add main page file if generated
|
||||
if(EXISTS "${OUTPUT_DIR}/main_page.dox")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${OUTPUT_DIR}/main_page.dox\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
|
||||
# Add header files to Doxygen input
|
||||
if(DEFINED DOXYGEN_INPUT_FILES_STRING)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${DOXYGEN_INPUT_FILES_STRING}\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Custom CSS
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/dox/resources/custom.css")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_DIR}/dox/resources/custom.css\n")
|
||||
endif()
|
||||
|
||||
# Set paths for dot tool
|
||||
if(GRAPHVIZ_DOT_EXECUTABLE)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOT_PATH = ${GRAPHVIZ_DOT_EXECUTABLE}\n")
|
||||
get_filename_component(DOT_DIRECTORY ${GRAPHVIZ_DOT_EXECUTABLE} DIRECTORY)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFONTPATH = ${DOT_DIRECTORY}\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFILE_DIRS = ${OUTPUT_DIR}/html\n")
|
||||
endif()
|
||||
|
||||
# Confirm file creation
|
||||
if(EXISTS ${DOXYGEN_CONFIG_FILE})
|
||||
message(STATUS "Successfully created Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
|
||||
else()
|
||||
message(FATAL_ERROR "Failed to create Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Function to check if required tools are available
|
||||
function(OCCT_DOC_CHECK_TOOLS)
|
||||
# Find Doxygen
|
||||
find_package(Doxygen QUIET)
|
||||
if(NOT DOXYGEN_FOUND)
|
||||
message(WARNING "Doxygen not found. Documentation will not be generated.")
|
||||
set(OCCT_DOC_TOOLS_AVAILABLE FALSE PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Find Graphviz
|
||||
find_program(GRAPHVIZ_DOT_EXECUTABLE NAMES dot)
|
||||
|
||||
# Check for MathJax for LaTeX formulas
|
||||
if(NOT MATHJAX_PATH)
|
||||
set(MATHJAX_PATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5")
|
||||
endif()
|
||||
|
||||
# Find tools for PDF generation if needed
|
||||
if(BUILD_DOC_PDF)
|
||||
# Find pdflatex
|
||||
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex)
|
||||
if(NOT PDFLATEX_EXECUTABLE)
|
||||
message(WARNING "pdflatex not found. PDF documentation will not be generated.")
|
||||
set(BUILD_DOC_PDF FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Find Inkscape (for SVG to PNG conversion for PDFs)
|
||||
find_program(INKSCAPE_EXECUTABLE NAMES inkscape)
|
||||
if(NOT INKSCAPE_EXECUTABLE)
|
||||
message(WARNING "Inkscape not found. SVG images will not be properly converted in PDF documentation.")
|
||||
endif()
|
||||
|
||||
set(PDFLATEX_EXECUTABLE ${PDFLATEX_EXECUTABLE} PARENT_SCOPE)
|
||||
set(INKSCAPE_EXECUTABLE ${INKSCAPE_EXECUTABLE} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Find tools for CHM generation if needed
|
||||
if(BUILD_DOC_CHM AND WIN32)
|
||||
# Find HTML Help Compiler
|
||||
find_program(HHC_EXECUTABLE NAMES hhc HHC)
|
||||
if(NOT HHC_EXECUTABLE)
|
||||
message(WARNING "HTML Help Compiler not found. CHM documentation will not be generated.")
|
||||
set(BUILD_DOC_CHM FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(HHC_EXECUTABLE ${HHC_EXECUTABLE} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(GRAPHVIZ_DOT_EXECUTABLE ${GRAPHVIZ_DOT_EXECUTABLE} PARENT_SCOPE)
|
||||
set(MATHJAX_PATH ${MATHJAX_PATH} PARENT_SCOPE)
|
||||
set(OCCT_DOC_TOOLS_AVAILABLE TRUE PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to process LaTeX files for PDF generation
|
||||
function(OCCT_DOC_PROCESS_LATEX OUTPUT_DIR)
|
||||
# Skip if PDF generation is not enabled or pdflatex not found
|
||||
if(NOT BUILD_DOC_PDF OR NOT PDFLATEX_EXECUTABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "Processing LaTeX files for PDF generation...")
|
||||
|
||||
# Process SVG images if Inkscape is available
|
||||
if(INKSCAPE_EXECUTABLE)
|
||||
file(GLOB SVG_FILES "${OUTPUT_DIR}/latex/*.svg")
|
||||
foreach(SVG_FILE ${SVG_FILES})
|
||||
get_filename_component(FILE_NAME ${SVG_FILE} NAME_WE)
|
||||
set(PNG_FILE "${OUTPUT_DIR}/latex/${FILE_NAME}.png")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${INKSCAPE_EXECUTABLE} -z -e ${PNG_FILE} ${SVG_FILE}
|
||||
RESULT_VARIABLE INKSCAPE_RESULT
|
||||
)
|
||||
|
||||
if(NOT INKSCAPE_RESULT EQUAL 0)
|
||||
message(WARNING "Failed to convert ${SVG_FILE} to PNG")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Generate PDF from LaTeX
|
||||
execute_process(
|
||||
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
|
||||
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
|
||||
RESULT_VARIABLE LATEX_RESULT
|
||||
OUTPUT_VARIABLE LATEX_OUTPUT
|
||||
ERROR_VARIABLE LATEX_ERROR
|
||||
)
|
||||
|
||||
if(NOT LATEX_RESULT EQUAL 0)
|
||||
message(WARNING "Error generating PDF: ${LATEX_ERROR}")
|
||||
else()
|
||||
# Run pdflatex again for references
|
||||
execute_process(
|
||||
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
|
||||
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
|
||||
)
|
||||
|
||||
message(STATUS "PDF documentation generated at ${OUTPUT_DIR}/latex/refman.pdf")
|
||||
|
||||
# Copy the PDF to a more accessible location
|
||||
file(COPY "${OUTPUT_DIR}/latex/refman.pdf" DESTINATION "${OUTPUT_DIR}")
|
||||
file(RENAME "${OUTPUT_DIR}/refman.pdf" "${OUTPUT_DIR}/${DOC_OUTPUT_NAME}.pdf")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Main function to set up documentation targets
|
||||
function(OCCT_SETUP_DOC_TARGETS)
|
||||
# Check if required tools are available
|
||||
OCCT_DOC_CHECK_TOOLS()
|
||||
if(NOT OCCT_DOC_TOOLS_AVAILABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Load lists of documentation files
|
||||
OCCT_DOC_LOAD_FILE_LISTS()
|
||||
|
||||
# Collect module information
|
||||
OCCT_DOC_COLLECT_MODULES_INFO()
|
||||
|
||||
# Extract toolkit dependencies
|
||||
OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES()
|
||||
|
||||
# Create documentation output directories
|
||||
set(DOC_ROOT_DIR "${CMAKE_BINARY_DIR}/doc")
|
||||
file(MAKE_DIRECTORY ${DOC_ROOT_DIR})
|
||||
|
||||
# Setup Reference Manual target
|
||||
if(BUILD_DOC_RefMan)
|
||||
# Create output directories
|
||||
set(REFMAN_OUTPUT_DIR "${DOC_ROOT_DIR}/refman")
|
||||
file(MAKE_DIRECTORY ${REFMAN_OUTPUT_DIR})
|
||||
file(MAKE_DIRECTORY "${REFMAN_OUTPUT_DIR}/html")
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${REFMAN_OUTPUT_DIR}")
|
||||
|
||||
# Generate main page for reference manual
|
||||
OCCT_DOC_GENERATE_MAIN_PAGE(${REFMAN_OUTPUT_DIR} "main_page.dox")
|
||||
|
||||
# Configure Doxygen
|
||||
set(DOC_TYPE "REFMAN")
|
||||
OCCT_DOC_CONFIGURE_DOXYGEN(${REFMAN_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
|
||||
|
||||
# Add custom target for reference manual
|
||||
add_custom_target(RefMan
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${REFMAN_OUTPUT_DIR}/Doxyfile
|
||||
COMMENT "Generating Reference Manual with Doxygen"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Add custom command to install generated documentation if required
|
||||
if(INSTALL_DOC_RefMan)
|
||||
install(DIRECTORY "${REFMAN_OUTPUT_DIR}/html/"
|
||||
DESTINATION "${INSTALL_DIR_DOC}/refman/html"
|
||||
OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Setup Overview documentation target (after RefMan so it can use the RefMan tag file)
|
||||
if(BUILD_DOC_Overview)
|
||||
# Create output directories
|
||||
set(OVERVIEW_OUTPUT_DIR "${DOC_ROOT_DIR}/overview")
|
||||
file(MAKE_DIRECTORY ${OVERVIEW_OUTPUT_DIR})
|
||||
file(MAKE_DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html")
|
||||
|
||||
# Configure Doxygen for Overview
|
||||
set(DOC_TYPE "OVERVIEW")
|
||||
OCCT_DOC_CONFIGURE_DOXYGEN(${OVERVIEW_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
|
||||
|
||||
# Add custom target for overview documentation
|
||||
add_custom_target(Overview
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${OVERVIEW_OUTPUT_DIR}/Doxyfile
|
||||
COMMENT "Generating Overview documentation with Doxygen"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${OVERVIEW_OUTPUT_DIR}")
|
||||
|
||||
# Add custom command to copy generated documentation to install location if required
|
||||
if(INSTALL_DOC_Overview)
|
||||
install(DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html/"
|
||||
DESTINATION "${INSTALL_DIR_DOC}/overview/html"
|
||||
OPTIONAL)
|
||||
|
||||
# Create overview.html only for windows
|
||||
if(WIN32)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/dox/resources/overview.html"
|
||||
DESTINATION "${INSTALL_DIR_DOC}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Combined documentation target
|
||||
if(BUILD_DOC_Overview AND BUILD_DOC_RefMan)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS RefMan Overview
|
||||
COMMENT "Generating all documentation"
|
||||
)
|
||||
set_property (TARGET doc PROPERTY FOLDER "Documentation")
|
||||
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
|
||||
elseif(BUILD_DOC_Overview)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS Overview
|
||||
COMMENT "Generating Overview documentation"
|
||||
)
|
||||
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
||||
elseif(BUILD_DOC_RefMan)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS RefMan
|
||||
COMMENT "Generating Reference Manual"
|
||||
)
|
||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||
endif()
|
||||
endfunction()
|
@ -199,6 +199,19 @@ set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
|
||||
|
||||
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
|
||||
|
||||
# Documentation variables
|
||||
set (BUILD_DOC_Overview_DESCR
|
||||
"Build OCCT overview documentation using Doxygen")
|
||||
|
||||
set (BUILD_DOC_RefMan_DESCR
|
||||
"Build OCCT reference manual documentation using Doxygen")
|
||||
|
||||
set (INSTALL_DOC_Overview_DESCR
|
||||
"Install OCCT overview documentation")
|
||||
|
||||
set (INSTALL_DOC_RefMan_DESCR
|
||||
"Install OCCT reference manual documentation")
|
||||
|
||||
macro (BUILD_MODULE MODULE_NAME)
|
||||
set (ENABLE_MODULE TRUE)
|
||||
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
|
||||
|
19
adm/gendoc
19
adm/gendoc
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Helper script to run generation of OCCT documentation on Linux.
|
||||
# Running it requires that Tcl, Doxygen, and MikTex (for PDF generation) should be in the PATH
|
||||
|
||||
anArgs=$*
|
||||
anOldPath="$PATH"
|
||||
anOldLd="$LD_LIBRARY_PATH"
|
||||
anOldDyLd="$DYLD_LIBRARY_PATH"
|
||||
|
||||
# go to the script directory
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
if [ -e "${aScriptPath}/../env.sh" ]; then source "${aScriptPath}/../env.sh"; fi
|
||||
|
||||
tclsh "${aScriptPath}/start.tcl" gendoc $anArgs
|
||||
|
||||
export PATH="$anOldPath"
|
||||
export LD_LIBRARY_PATH="$anOldLd"
|
||||
export DYLD_LIBRARY_PATH="$anOldDyLd"
|
@ -1,23 +0,0 @@
|
||||
@echo off
|
||||
|
||||
rem Helper script to run generation of OCCT documentation on Windows.
|
||||
rem Running it requires that Tcl, Doxygen, and MikTex (for PDF generation)
|
||||
rem should be in the PATH
|
||||
|
||||
SET "OLD_PATH=%PATH%"
|
||||
|
||||
if exist "%~dp0../env.bat" (
|
||||
call "%~dp0../env.bat"
|
||||
)
|
||||
|
||||
set "TCL_EXEC=tclsh.exe"
|
||||
|
||||
for %%X in (%TCL_EXEC%) do (set TCL_FOUND=%%~$PATH:X)
|
||||
|
||||
if defined TCL_FOUND (
|
||||
%TCL_EXEC% %~dp0start.tcl gendoc %*
|
||||
) else (
|
||||
echo "Error. %TCL_EXEC% is not found. Please update PATH variable"
|
||||
)
|
||||
|
||||
SET "PATH=%OLD_PATH%"
|
906
adm/gendoc.tcl
906
adm/gendoc.tcl
@ -1,906 +0,0 @@
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# =======================================================================
|
||||
# This script defines command gendoc compiling OCCT documents
|
||||
# from *.md files to HTML pages
|
||||
# =======================================================================
|
||||
|
||||
# load auxiliary tools
|
||||
source [file join [file dirname [info script]] occaux.tcl]
|
||||
|
||||
# ======================================
|
||||
# Common functions
|
||||
# ======================================
|
||||
|
||||
# Prints help message
|
||||
proc OCCDoc_PrintHelpMessage {} {
|
||||
puts "\nUsage: gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]"
|
||||
puts ""
|
||||
puts "Options are:"
|
||||
puts ""
|
||||
puts "choice of documentation to be generated:"
|
||||
puts " -overview : To generate Overview and User Guides"
|
||||
puts " (cannot be used with -refman)"
|
||||
puts " -refman : To generate class Reference Manual"
|
||||
puts " (cannot be used with -overview)"
|
||||
puts ""
|
||||
puts "choice of output format:"
|
||||
puts " -html : To generate HTML files"
|
||||
puts " (default, cannot be used with -pdf or -chm)"
|
||||
puts " -pdf : To generate PDF files"
|
||||
puts " (cannot be used with -refman, -html, or -chm)"
|
||||
puts " -chm : To generate CHM files"
|
||||
puts " (cannot be used with -html or -pdf)"
|
||||
puts ""
|
||||
puts "additional options:"
|
||||
puts " -m=<modules_list> : List of OCCT modules (separated with comma),"
|
||||
puts " for generation of Reference Manual"
|
||||
puts " -ug=<docs_list> : List of MarkDown documents (separated with comma),"
|
||||
puts " to use for generation of Overview / User Guides"
|
||||
puts " -mathjax=<path> : To use local or alternative copy of MathJax"
|
||||
puts " -s=<search_mode> : Specifies the Search mode of HTML documents"
|
||||
puts " Can be: none | local | server | external"
|
||||
puts " -h : Prints this help message"
|
||||
puts " -v : Enables more verbose output"
|
||||
}
|
||||
|
||||
# A command for User Documentation compilation
|
||||
proc gendoc {args} {
|
||||
|
||||
# Parameters
|
||||
set DOC_TYPE "REFMAN"
|
||||
set GEN_MODE "HTML_ONLY"
|
||||
set DOCFILES {}
|
||||
set MODULES {}
|
||||
set DOCLABEL ""
|
||||
set VERB_MODE "NO"
|
||||
set SEARCH_MODE "none"
|
||||
set MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1"
|
||||
set mathjax_js_name "MathJax.js"
|
||||
set DOCTYPE_COMBO_FLAG 0
|
||||
set GENMODE_COMBO_FLAG 0
|
||||
set GENERATE_PRODUCTS_REFMAN "NO"
|
||||
|
||||
global available_docfiles; # The full list of md files for HTML or CHM generation
|
||||
global available_pdf; # The full list of md files for PDF generation
|
||||
global tcl_platform
|
||||
global args_names
|
||||
global args_values
|
||||
global env
|
||||
|
||||
# Load list of docfiles
|
||||
if { [OCCDoc_LoadFilesList] != 0 } {
|
||||
puts "Error: File FILES_HTML.txt or FILES_PDF.txt was not found on this computer.\nAborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
# Parse CL arguments
|
||||
if {[OCCDoc_ParseArguments $args] == 1} {
|
||||
return -1
|
||||
}
|
||||
|
||||
# Print help message if no arguments provided
|
||||
if {[llength $args_names] == 0} {
|
||||
OCCDoc_PrintHelpMessage
|
||||
return 0
|
||||
}
|
||||
|
||||
foreach arg_n $args_names {
|
||||
if {$arg_n == "h"} {
|
||||
OCCDoc_PrintHelpMessage
|
||||
return 0
|
||||
} elseif {$arg_n == "html"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "HTML_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm can not be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "chm"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "CHM_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm cannot be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "pdf"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "PDF_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm cannot be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "overview"} {
|
||||
if { $DOCTYPE_COMBO_FLAG != 1 } {
|
||||
set DOC_TYPE "OVERVIEW"
|
||||
set DOCTYPE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -refman and -overview cannot be combined."
|
||||
return -1
|
||||
}
|
||||
|
||||
# Print ignored options
|
||||
if { [ lsearch $args_names "m" ] != -1 } {
|
||||
puts "\nInfo: The following options will be ignored: \n"
|
||||
puts " * -m"
|
||||
}
|
||||
puts ""
|
||||
} elseif {$arg_n == "refman"} {
|
||||
if { $DOCTYPE_COMBO_FLAG != 1 } {
|
||||
set DOC_TYPE "REFMAN"
|
||||
set DOCTYPE_COMBO_FLAG 1
|
||||
if { [file exists [OCCDoc_GetProdRootDir]/src/VAS/Products.tcl] } {
|
||||
set GENERATE_PRODUCTS_REFMAN "YES"
|
||||
}
|
||||
} else {
|
||||
puts "Error: Options -refman and -overview cannot be combined."
|
||||
return -1
|
||||
}
|
||||
# Print ignored options
|
||||
if { ([ lsearch $args_names "pdf" ] != -1) ||
|
||||
([ lsearch $args_names "chm" ] != -1) ||
|
||||
([ lsearch $args_names "ug" ] != -1) } {
|
||||
puts "\nInfo: The following options will be ignored: \n"
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts " * -pdf"
|
||||
}
|
||||
if { [ lsearch $args_names "chm" ] != -1 } {
|
||||
puts " * -chm"
|
||||
}
|
||||
if { [ lsearch $args_names "ug" ] != -1 } {
|
||||
puts " * -ug"
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
|
||||
} elseif {$arg_n == "v"} {
|
||||
set VERB_MODE "YES"
|
||||
} elseif {$arg_n == "ug"} {
|
||||
if { ([ lsearch $args_names "refman" ] != -1) } {
|
||||
continue
|
||||
}
|
||||
if {$args_values(ug) != "NULL"} {
|
||||
set DOCFILES $args_values(ug)
|
||||
} else {
|
||||
puts "Error in argument ug."
|
||||
return -1
|
||||
}
|
||||
# Check if all chosen docfiles are correct
|
||||
foreach docfile $DOCFILES {
|
||||
if { [ lsearch $args_names "pdf" ] == -1 } {
|
||||
# Check to generate HTMLs
|
||||
if { [lsearch $available_docfiles $docfile] == -1 } {
|
||||
puts "Error: File \"$docfile\" is not presented in the list of available docfiles."
|
||||
puts " Please specify the correct docfile name."
|
||||
return -1
|
||||
}
|
||||
} else {
|
||||
# Check to generate PDFs
|
||||
if { [lsearch $available_pdf $docfile] == -1 } {
|
||||
puts "Error: File \"$docfile\" is not presented in the list of generic PDFs."
|
||||
puts " Please specify the correct pdf name."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif {$arg_n == "m"} {
|
||||
if { [ lsearch $args_names "overview" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if {$args_values(m) != "NULL"} {
|
||||
set MODULES $args_values(m)
|
||||
} else {
|
||||
puts "Error in argument m."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "s"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: search is not used with PDF and will be ignored."
|
||||
continue
|
||||
}
|
||||
|
||||
if {$args_values(s) != "NULL"} {
|
||||
set SEARCH_MODE $args_values(s)
|
||||
} else {
|
||||
puts "Error in argument s."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "mathjax"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: MathJax is not used with PDF and will be ignored."
|
||||
}
|
||||
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
OCCDoc_PrintHelpMessage
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Check the existence of the necessary tools
|
||||
set DOXYGEN_PATH ""
|
||||
set GRAPHVIZ_PATH ""
|
||||
set INKSCAPE_PATH ""
|
||||
set PDFLATEX_PATH ""
|
||||
set HHC_PATH ""
|
||||
|
||||
OCCDoc_DetectNecessarySoftware $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH $PDFLATEX_PATH
|
||||
|
||||
if {$DOXYGEN_PATH == ""} {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
if {"$::tcl_platform(platform)" == "windows"} {
|
||||
if { ($GEN_MODE == "CHM_ONLY") && ($HHC_PATH == "") } {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
if { ($PDFLATEX_PATH == "") && ($GEN_MODE == "PDF_ONLY") } {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
# If we do not specify list for docfiles with -m argument,
|
||||
# we assume that we have to generate all docfiles
|
||||
if { [llength $DOCFILES] == 0 } {
|
||||
if { $GEN_MODE != "PDF_ONLY" } {
|
||||
set DOCFILES $available_docfiles
|
||||
} else {
|
||||
set DOCFILES $available_pdf
|
||||
}
|
||||
}
|
||||
|
||||
puts ""
|
||||
|
||||
# Start main activities
|
||||
if { $GEN_MODE != "PDF_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
} else {
|
||||
if { $DOC_TYPE == "REFMAN" } {
|
||||
if { $MODULES != "" } {
|
||||
foreach module $MODULES {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $module $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
} else {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
} else {
|
||||
foreach md $DOCFILES {
|
||||
OCCDoc_Main $DOC_TYPE $md $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts "Generating OCCT User Guides in PDF format..."
|
||||
foreach pdf $DOCFILES {
|
||||
|
||||
puts "\nInfo: Processing file $pdf"
|
||||
|
||||
# Some values are hardcoded because they are related only to PDF generation
|
||||
OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
|
||||
}
|
||||
}
|
||||
|
||||
# Main procedure for documents compilation
|
||||
proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode searchMode mathjaxLocation generateProductsRefman DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH} {
|
||||
|
||||
global available_docfiles
|
||||
global available_pdf
|
||||
|
||||
set ROOTDIR [OCCDoc_GetRootDir [OCCDoc_GetProdRootDir]]
|
||||
set INDIR [OCCDoc_GetDoxDir]
|
||||
set OUTDIR $ROOTDIR/doc
|
||||
set PDFDIR $OUTDIR/pdf
|
||||
set UGDIR $PDFDIR/user_guides
|
||||
set DGDIR $PDFDIR/dev_guides
|
||||
set TAGFILEDIR $OUTDIR/refman
|
||||
set HTMLDIR $OUTDIR/overview/html
|
||||
set LATEXDIR $OUTDIR/overview/latex
|
||||
set DOXYFILE $OUTDIR/OCCT.cfg
|
||||
|
||||
# OUTDIR for products documentation should be separate directories for each components
|
||||
if { [OCCDoc_GetProdRootDir] != ""} {
|
||||
if { $docType == "REFMAN" } {
|
||||
if { "$modules" != "" } {
|
||||
source "[OCCDoc_GetSourceDir [OCCDoc_GetProdRootDir]]/VAS/${modules}.tcl"
|
||||
set doc_component_name [${modules}:documentation_name]
|
||||
set OUTDIR $OUTDIR/$doc_component_name
|
||||
}
|
||||
} else {
|
||||
if {[regexp {([^/]+)/([^/]+)/([^/]+)} $docfiles dump doc_type doc_component doc_name]} {
|
||||
set PDFNAME [file rootname $doc_name]
|
||||
set OUTDIR $OUTDIR/$doc_component
|
||||
} else {
|
||||
error "Could not parse input path to *.md file: \"${docfiles}\""
|
||||
}
|
||||
}
|
||||
set HTMLDIR $OUTDIR/html
|
||||
set LATEXDIR $OUTDIR/latex
|
||||
set DOXYFILE $OUTDIR/OCCT.cfg
|
||||
set TAGFILEDIR $OUTDIR/refman
|
||||
}
|
||||
|
||||
# Create or cleanup the output folders
|
||||
if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
|
||||
if { ![file exists $OUTDIR] } {
|
||||
file mkdir $OUTDIR
|
||||
}
|
||||
if { ![file exists $HTMLDIR] } {
|
||||
file mkdir $HTMLDIR
|
||||
}
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
if { ![file exists $PDFDIR] } {
|
||||
file mkdir $PDFDIR
|
||||
}
|
||||
if { ![file exists $UGDIR] } {
|
||||
file mkdir $UGDIR
|
||||
}
|
||||
if { ![file exists $DGDIR] } {
|
||||
file mkdir $DGDIR
|
||||
}
|
||||
}
|
||||
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
if { [file exists $LATEXDIR] } {
|
||||
file delete -force $LATEXDIR
|
||||
}
|
||||
file mkdir $LATEXDIR
|
||||
}
|
||||
}
|
||||
if { $docType == "REFMAN" } {
|
||||
if { ![file exists $TAGFILEDIR] } {
|
||||
file mkdir $TAGFILEDIR
|
||||
}
|
||||
}
|
||||
|
||||
# is MathJax HLink?
|
||||
set mathjax_relative_location $mathjaxLocation
|
||||
if { [file isdirectory "$mathjaxLocation"] } {
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
# related path
|
||||
set mathjax_relative_location [OCCDoc_GetRelPath $HTMLDIR $mathjaxLocation]
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
# absolute path
|
||||
set mathjax_relative_location [file normalize $mathjaxLocation]
|
||||
}
|
||||
}
|
||||
|
||||
if { $generateProductsRefman == "YES" } {
|
||||
set DOCDIR "$OUTDIR/refman"
|
||||
puts "\nGenerating OCC Products Reference Manual\n"
|
||||
} else {
|
||||
if { $docType == "REFMAN"} {
|
||||
set DOCDIR "$OUTDIR/refman"
|
||||
puts "\nGenerating Open CASCADE Reference Manual\n"
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
set DOCDIR "$OUTDIR/overview"
|
||||
} else {
|
||||
set DOCDIR "$OUTDIR"
|
||||
}
|
||||
set FORMAT ""
|
||||
if { ($generatorMode == "HTML_ONLY") || ($generatorMode == "CHM_ONLY") } {
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
set FORMAT " in HTML format..."
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
set FORMAT " in CHM format..."
|
||||
}
|
||||
puts "Generating OCCT User Guides$FORMAT\n"
|
||||
}
|
||||
} else {
|
||||
puts "Error: Invalid documentation type: $docType. Can not process."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Generate Doxyfile
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
|
||||
|
||||
if { [OCCDoc_MakeDoxyfile $docType $DOCDIR $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $modules $verboseMode $searchMode $HHC_PATH $mathjax_relative_location $GRAPHVIZ_PATH [OCCDoc_GetProdRootDir]] == -1 } {
|
||||
return -1
|
||||
}
|
||||
|
||||
# Run doxygen tool
|
||||
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
|
||||
if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
|
||||
set LOGPREFIX "html_"
|
||||
puts "$starttimestamp Generating HTML files..."
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file copy -force $INDIR/resources/index.html $DOCDIR/index.html
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
set LOGPREFIX "chm_"
|
||||
puts "$starttimestamp Generating CHM file..."
|
||||
} elseif { $generatorMode == "PDF_ONLY" } {
|
||||
set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
|
||||
puts "$starttimestamp Generating PDF file..."
|
||||
}
|
||||
|
||||
# Clean logfiles
|
||||
set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
|
||||
set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
|
||||
file delete -force $DOXYLOG
|
||||
file delete -force $DOXYOUT
|
||||
|
||||
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR]
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: Doxygen reported $NbErrors messages."
|
||||
puts "See log in $DOXYLOG"
|
||||
set DOX_ERROR_FILE [open $DOXYLOG "a"]
|
||||
if {$generatorMode == "PDF_ONLY"} {
|
||||
puts $DOX_ERROR_FILE "\n===================================================="
|
||||
puts $DOX_ERROR_FILE "Logfile for $docfiles"
|
||||
puts $DOX_ERROR_FILE "====================================================\n"
|
||||
}
|
||||
puts $DOX_ERROR_FILE $DOX_ERROR
|
||||
close $DOX_ERROR_FILE
|
||||
}
|
||||
}
|
||||
|
||||
# Close the Doxygen application
|
||||
after 300
|
||||
|
||||
# Start Post Processing
|
||||
set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
if { $docType == "REFMAN" } {
|
||||
# Post Process generated HTML pages and draw dependency graphs
|
||||
if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
|
||||
puts "$curtime Generation completed."
|
||||
puts "\nInfo: doxygen log file is located in:"
|
||||
puts "${DOXYOUT}."
|
||||
puts "\nReference Manual is generated in \n$DOCDIR"
|
||||
}
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
# Start PDF generation routine
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
set OS $::tcl_platform(platform)
|
||||
if { $OS == "unix" } {
|
||||
set PREFIX ".sh"
|
||||
} elseif { $OS == "windows" } {
|
||||
set PREFIX ".bat"
|
||||
}
|
||||
|
||||
# Prepare a list of TeX files, generated by Doxygen
|
||||
cd $LATEXDIR
|
||||
|
||||
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
|
||||
foreach path $TEXFILES {
|
||||
if { [string compare -nocase $path $LATEXDIR] == 0 } {
|
||||
set DEL_IDX [lsearch $TEXFILES $path]
|
||||
if { $DEL_IDX != -1 } {
|
||||
set TEXFILES [lreplace $TEXFILES $DEL_IDX $DEL_IDX]
|
||||
}
|
||||
}
|
||||
}
|
||||
set TEXFILES [string map [list refman.tex ""] $TEXFILES]
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Preprocessing generated TeX files..."
|
||||
}
|
||||
OCCDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Converting SVG images to PNG format..."
|
||||
}
|
||||
|
||||
if { $INKSCAPE_PATH != "" } {
|
||||
OCCDoc_ProcessSvg $LATEXDIR $verboseMode
|
||||
} else {
|
||||
puts "Warning: SVG images will be lost in PDF documents."
|
||||
}
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Generating PDF file from TeX files..."
|
||||
}
|
||||
foreach TEX $TEXFILES {
|
||||
# Rewrite existing REFMAN.tex file...
|
||||
set TEX [lindex [split $TEX "."] 0]
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Generating PDF file from $TEX..."
|
||||
}
|
||||
|
||||
OCCDoc_MakeRefmanTex $TEX $LATEXDIR $verboseMode $available_pdf
|
||||
|
||||
if {"$::tcl_platform(platform)" == "windows"} {
|
||||
set is_win "yes"
|
||||
} else {
|
||||
set is_win "no"
|
||||
}
|
||||
if {$verboseMode == "YES"} {
|
||||
# ...and use it to generate PDF from TeX...
|
||||
if {$is_win == "yes"} {
|
||||
puts "Info: Executing $LATEXDIR/make.bat..."
|
||||
} else {
|
||||
puts "Info: Executing $LATEXDIR/Makefile..."
|
||||
}
|
||||
}
|
||||
|
||||
set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
|
||||
set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
|
||||
file delete -force $PDFLOG
|
||||
file delete -force $PDFOUT
|
||||
|
||||
if {"$is_win" == "yes"} {
|
||||
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
|
||||
} else {
|
||||
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
|
||||
# Small workaround for *nix stations
|
||||
set prev_loc [pwd]
|
||||
cd $LATEXDIR
|
||||
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
cd $prev_loc
|
||||
}
|
||||
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
|
||||
set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
|
||||
puts $LaTeX_ERROR_FILE "\n===================================================="
|
||||
puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
|
||||
puts $LaTeX_ERROR_FILE "====================================================\n"
|
||||
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
|
||||
close $LaTeX_ERROR_FILE
|
||||
}
|
||||
}
|
||||
|
||||
# ...and place it to the specific folder
|
||||
if {![file exists "$LATEXDIR/refman.pdf"]} {
|
||||
puts "Fatal: PDFLaTeX failed to create output file, stopping!"
|
||||
return -1
|
||||
}
|
||||
|
||||
set destFolder $PDFDIR
|
||||
set parsed_string [split $TEX "_"]
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
if { [lsearch $parsed_string "tutorial"] != -1 } {
|
||||
set TEX [string map [list occt__ occt_] $TEX]
|
||||
set destFolder $PDFDIR
|
||||
} elseif { [lsearch $parsed_string "user"] != -1 } {
|
||||
set TEX [string map [list user_guides__ ""] $TEX]
|
||||
set destFolder $UGDIR
|
||||
} elseif { [lsearch $parsed_string "dev"] != -1 } {
|
||||
set TEX [string map [list dev_guides__ ""] $TEX]
|
||||
set destFolder $DGDIR
|
||||
}
|
||||
} else {
|
||||
set destFolder $OUTDIR
|
||||
set TEX "$PDFNAME"
|
||||
}
|
||||
file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
|
||||
puts "Generated $destFolder/$TEX.pdf"
|
||||
}
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
file rename $OUTDIR/overview.chm $OUTDIR/occt_overview.chm
|
||||
} else {
|
||||
file rename -force $ROOTDIR/doc/overview.chm $OUTDIR/occt_overview.chm
|
||||
}
|
||||
}
|
||||
cd $INDIR
|
||||
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
puts "HTML documentation is generated in \n$DOCDIR"
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
|
||||
}
|
||||
}
|
||||
|
||||
# Remove temporary Doxygen files
|
||||
set deleteList [glob -nocomplain -type f "*.tmp"]
|
||||
foreach file $deleteList {
|
||||
file delete $file
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Generates Doxygen configuration file for Overview documentation
|
||||
proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
|
||||
global module_dependency
|
||||
|
||||
set inputDir [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
|
||||
|
||||
set TEMPLATES_DIR [OCCDoc_GetDoxDir]/resources
|
||||
set occt_version [OCCDoc_DetectCasVersion]
|
||||
|
||||
# Delete existent doxyfile
|
||||
file delete $doxyFileName
|
||||
|
||||
# Copy specific template to the target folder
|
||||
if { $docType == "REFMAN" } {
|
||||
file copy "$TEMPLATES_DIR/occt_rm.doxyfile" $doxyFileName
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
if { $generatorMode == "HTML_ONLY" || $generatorMode == "CHM_ONLY" } {
|
||||
file copy "$TEMPLATES_DIR/occt_ug_html.doxyfile" $doxyFileName
|
||||
} elseif { $generatorMode == "PDF_ONLY"} {
|
||||
file copy "$TEMPLATES_DIR/occt_ug_pdf.doxyfile" $doxyFileName
|
||||
} else {
|
||||
puts "Error: Unknown generation mode"
|
||||
return -1
|
||||
}
|
||||
} else {
|
||||
puts "Error: Cannot generate unknown document type"
|
||||
return -1
|
||||
}
|
||||
|
||||
set doxyFile [open $doxyFileName "a"]
|
||||
# Write specific options
|
||||
if { $docType == "REFMAN" } {
|
||||
|
||||
# always include optional components
|
||||
set aHaveD3dBack ""
|
||||
set aHaveGlesBack ""
|
||||
set aHaveVtkBack ""
|
||||
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
|
||||
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
|
||||
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
|
||||
set ::env(HAVE_D3D) "true"
|
||||
set ::env(HAVE_GLES2) "true"
|
||||
set ::env(HAVE_VTK) "true"
|
||||
|
||||
# Load lists of modules scripts
|
||||
if { $productsPath == "" } {
|
||||
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
|
||||
} else {
|
||||
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
|
||||
}
|
||||
if { [llength $modules_scripts] != 0} {
|
||||
foreach module_file $modules_scripts {
|
||||
source $module_file
|
||||
}
|
||||
}
|
||||
|
||||
set ALL_MODULES [OCCDoc_GetModulesList $productsPath]
|
||||
if { [llength $ModulesList] == 0 } {
|
||||
# by default take all modules
|
||||
set modules $ALL_MODULES
|
||||
} else {
|
||||
set modules $ModulesList
|
||||
}
|
||||
|
||||
# Detect invalid names of modules
|
||||
foreach module $modules {
|
||||
if { $module == "" } {
|
||||
continue
|
||||
}
|
||||
if {[lsearch $ALL_MODULES $module] == -1 } {
|
||||
puts "Error: No module $module is known. Aborting..."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Set context
|
||||
set one_module [expr [llength $modules] == 1]
|
||||
if { $one_module } {
|
||||
set title "OCCT [$modules:name]"
|
||||
set name $modules
|
||||
} else {
|
||||
set title "Open CASCADE Technology"
|
||||
set name OCCT
|
||||
}
|
||||
|
||||
OCCDoc_LoadData "${productsPath}"
|
||||
|
||||
# Add all dependencies of modules to the graph
|
||||
set additional_modules {}
|
||||
foreach module $modules {
|
||||
set additional_modules [list {*}$additional_modules {*}$module_dependency($module)]
|
||||
}
|
||||
set modules [list {*}$modules {*}$additional_modules]
|
||||
set modules [lsort -unique $modules]
|
||||
|
||||
# Get list of header files in the specified modules
|
||||
set filelist {}
|
||||
foreach module $modules {
|
||||
if { $module == "" } {
|
||||
continue
|
||||
}
|
||||
foreach tk [$module:toolkits] {
|
||||
foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
|
||||
if { [llength $pk] != "{}" } {
|
||||
lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Filter out files Handle_*.hxx and *.lxx
|
||||
set hdrlist {}
|
||||
foreach fileset $filelist {
|
||||
set hdrset {}
|
||||
foreach hdr $fileset {
|
||||
if { ! [regexp {Handle_.*[.]hxx} $hdr] && ! [regexp {.*[.]lxx} $hdr] } {
|
||||
lappend hdrset $hdr
|
||||
}
|
||||
}
|
||||
lappend hdrlist $hdrset
|
||||
}
|
||||
set filelist $hdrlist
|
||||
|
||||
set doxyFile [open $doxyFileName "a"]
|
||||
|
||||
puts $doxyFile "PROJECT_NAME = \"$title\""
|
||||
puts $doxyFile "PROJECT_NUMBER = $occt_version"
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
|
||||
puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
|
||||
|
||||
if { [string tolower $searchMode] == "none" } {
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} else {
|
||||
puts $doxyFile "SEARCHENGINE = YES"
|
||||
if { [string tolower $searchMode] == "local" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "server" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "external" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = YES"
|
||||
} else {
|
||||
puts "Error: Wrong search engine type: $searchMode."
|
||||
close $doxyFile
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
|
||||
puts $doxyFile "DOT_PATH = $graphvizPath"
|
||||
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
||||
|
||||
# list of files to generate
|
||||
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
|
||||
puts $doxyFile ""
|
||||
puts $doxyFile "INPUT = $mainpage \\"
|
||||
foreach header $filelist {
|
||||
puts $doxyFile " $header \\"
|
||||
}
|
||||
|
||||
puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
|
||||
puts $doxyFile ""
|
||||
|
||||
# restore environment variables
|
||||
set ::env(HAVE_D3D) "$aHaveD3dBack"
|
||||
set ::env(HAVE_GLES2) "$aHaveGlesBack"
|
||||
set ::env(HAVE_VTK) "$aHaveVtkBack"
|
||||
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
|
||||
# Add common options for generation of Overview and User Guides
|
||||
puts $doxyFile "PROJECT_NUMBER = $occt_version"
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
|
||||
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
|
||||
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
||||
|
||||
set PARAM_INPUT "INPUT ="
|
||||
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "
|
||||
foreach docFile $DocFilesList {
|
||||
set NEW_IMG_PATH "$inputDir/$docFile"
|
||||
if { [string compare $NEW_IMG_PATH [OCCDoc_GetRootDir $productsPath]] != 0 } {
|
||||
set img_string [file dirname $NEW_IMG_PATH]/images
|
||||
if { [file exists $img_string] } {
|
||||
append PARAM_IMAGEPATH " $img_string"
|
||||
}
|
||||
}
|
||||
append PARAM_INPUT " " $inputDir/$docFile
|
||||
}
|
||||
puts $doxyFile $PARAM_INPUT
|
||||
puts $doxyFile $PARAM_IMAGEPATH
|
||||
|
||||
# Add document type-specific options
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
# generate tree view
|
||||
puts $doxyFile "GENERATE_TREEVIEW = YES"
|
||||
|
||||
# Set a reference to a TAGFILE
|
||||
if { $tagFileDir != "" } {
|
||||
if {[file exists $tagFileDir/OCCT.tag] == 1} {
|
||||
#set tagPath [OCCDoc_GetRelPath $tagFileDir $outDir/html]
|
||||
set tagPath $tagFileDir
|
||||
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
|
||||
}
|
||||
}
|
||||
# HTML Search engine options
|
||||
if { [string tolower $searchMode] == "none" } {
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} else {
|
||||
puts $doxyFile "SEARCHENGINE = YES"
|
||||
if { [string tolower $searchMode] == "local" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "server" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "external" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = YES"
|
||||
} else {
|
||||
puts "Error: Wrong search engine type: $searchMode."
|
||||
close $doxyFile
|
||||
return -1
|
||||
}
|
||||
}
|
||||
} elseif { $generatorMode == "CHM_ONLY"} {
|
||||
# specific options for CHM file generation
|
||||
puts $doxyFile "GENERATE_TREEVIEW = NO"
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "GENERATE_HTMLHELP = YES"
|
||||
puts $doxyFile "CHM_FILE = ../../overview.chm"
|
||||
puts $doxyFile "HHC_LOCATION = \"$hhcPath\""
|
||||
puts $doxyFile "DISABLE_INDEX = YES"
|
||||
}
|
||||
|
||||
# Formula options
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
}
|
||||
|
||||
close $doxyFile
|
||||
return 0
|
||||
}
|
940
adm/occaux.tcl
940
adm/occaux.tcl
@ -1,940 +0,0 @@
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# =======================================================================
|
||||
# This script contains auxiliary functions which can be used
|
||||
# in documentation generation process
|
||||
# =======================================================================
|
||||
|
||||
# ==============================================
|
||||
# Commonly used functions
|
||||
# ==============================================
|
||||
|
||||
# Parses arguments line like "-arg1=val1 -arg2=val2 ..." to array args_names and map args_values
|
||||
proc OCCDoc_ParseArguments {arguments} {
|
||||
global args_names
|
||||
global args_values
|
||||
set args_names {}
|
||||
array set args_values {}
|
||||
|
||||
foreach arg $arguments {
|
||||
if {[regexp {^(-)[a-z_]+$} $arg] == 1} {
|
||||
set name [string range $arg 1 [string length $arg]-1]
|
||||
lappend args_names $name
|
||||
set args_values($name) "NULL"
|
||||
continue
|
||||
} elseif {[regexp {^(-)[a-z_]+=.+$} $arg] == 1} {
|
||||
set equal_symbol_position [string first "=" $arg]
|
||||
set name [string range $arg 1 $equal_symbol_position-1]
|
||||
lappend args_names $name
|
||||
set value [string range $arg $equal_symbol_position+1 [string length $arguments]-1]
|
||||
|
||||
# To parse a list of values for -m parameter
|
||||
if { [string first "," $value] != -1 } {
|
||||
set value [split $value ","];
|
||||
}
|
||||
|
||||
set args_values($name) $value
|
||||
|
||||
} else {
|
||||
puts "Error in argument $arg."
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Returns script parent folder
|
||||
proc OCCDoc_GetDoxDir { {theProductsPath ""} } {
|
||||
if { $theProductsPath == "" } {
|
||||
return [file normalize [file dirname [info script]]/../dox]
|
||||
} else {
|
||||
return [file normalize $theProductsPath]/dox
|
||||
}
|
||||
}
|
||||
|
||||
# Returns products root folder
|
||||
proc OCCDoc_GetProdRootDir {} {
|
||||
if {[info exists ::env(PRODROOT)]} {
|
||||
return [file normalize $::env(PRODROOT)]
|
||||
}
|
||||
}
|
||||
|
||||
# Returns OCCT root dir
|
||||
proc OCCDoc_GetOCCTRootDir {} {
|
||||
set path [OCCDoc_GetDoxDir]
|
||||
return [file normalize $path/..]
|
||||
}
|
||||
|
||||
# Returns root dir
|
||||
proc OCCDoc_GetRootDir { {theProductsPath ""} } {
|
||||
if { $theProductsPath == "" } {
|
||||
return [OCCDoc_GetOCCTRootDir]
|
||||
} else {
|
||||
return [file normalize $theProductsPath]
|
||||
}
|
||||
}
|
||||
|
||||
# Returns OCCT include dir
|
||||
proc OCCDoc_GetIncDir { {theProductsPath ""} } {
|
||||
set path [OCCDoc_GetRootDir $theProductsPath]
|
||||
return "$path/inc"
|
||||
}
|
||||
|
||||
# Returns OCCT source dir
|
||||
proc OCCDoc_GetSourceDir { {theProductsPath ""} } {
|
||||
set path [OCCDoc_GetRootDir $theProductsPath]
|
||||
return "$path/src"
|
||||
}
|
||||
|
||||
# Returns name of the package from the current toolkit
|
||||
proc OCCDoc_GetNameFromPath { thePath } {
|
||||
|
||||
set splitted_path [split $thePath "/" ]
|
||||
set package_name [lindex $splitted_path end]
|
||||
|
||||
return $package_name
|
||||
}
|
||||
|
||||
# Returns the relative path between two folders
|
||||
proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
|
||||
if { [file isdirectory "$thePathFrom"] == 0 } {
|
||||
return ""
|
||||
}
|
||||
|
||||
set aPathFrom [file normalize "$thePathFrom"]
|
||||
set aPathTo [file normalize "$thePathTo"]
|
||||
|
||||
set aCutedPathFrom "${aPathFrom}/dummy"
|
||||
set aRelatedDeepPath ""
|
||||
|
||||
while { "$aCutedPathFrom" != [file normalize "$aCutedPathFrom/.."] } {
|
||||
set aCutedPathFrom [file normalize "$aCutedPathFrom/.."]
|
||||
# does aPathTo contain aCutedPathFrom?
|
||||
regsub -all $aCutedPathFrom $aPathTo "" aPathFromAfterCut
|
||||
if { "$aPathFromAfterCut" != "$aPathTo" } { # if so
|
||||
if { "$aCutedPathFrom" == "$aPathFrom" } { # just go higher, for example, ./somefolder/someotherfolder
|
||||
set aPathTo ".${aPathTo}"
|
||||
} elseif { "$aCutedPathFrom" == "$aPathTo" } { # remove the last "/"
|
||||
set aRelatedDeepPath [string replace $aRelatedDeepPath end end ""]
|
||||
}
|
||||
regsub -all $aCutedPathFrom $aPathTo $aRelatedDeepPath aPathToAfterCut
|
||||
regsub -all "//" $aPathToAfterCut "/" aPathToAfterCut
|
||||
return $aPathToAfterCut
|
||||
}
|
||||
set aRelatedDeepPath "$aRelatedDeepPath../"
|
||||
}
|
||||
|
||||
return $thePathTo
|
||||
}
|
||||
|
||||
# Returns OCCT version string from version.cmake (if available)
|
||||
proc OCCDoc_DetectCasVersion {} {
|
||||
# Default version in case the file is not found or readable
|
||||
set occt_ver "7.8.0"
|
||||
set occt_ver_add ""
|
||||
|
||||
# Construct path to version.cmake relative to script location
|
||||
set filename "[file normalize [file dirname [info script]]/cmake/version.cmake]"
|
||||
|
||||
if { [file exists $filename] && [file readable $filename] } {
|
||||
if {[catch {
|
||||
set fh [open $filename "r"]
|
||||
set fh_loaded [read $fh]
|
||||
close $fh
|
||||
|
||||
# Use more robust regular expressions
|
||||
regexp {OCC_VERSION_MAJOR\s+(\d+)} $fh_loaded -> major
|
||||
regexp {OCC_VERSION_MINOR\s+(\d+)} $fh_loaded -> minor
|
||||
regexp {OCC_VERSION_MAINTENANCE\s+(\d+)} $fh_loaded -> maint
|
||||
regexp {OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded -> occt_ver_add
|
||||
|
||||
if {[info exists major] && [info exists minor] && [info exists maint]} {
|
||||
puts "Info: Open CASCADE Technology version $major.$minor.$maint"
|
||||
set occt_ver "$major.$minor.$maint"
|
||||
if { [info exists occt_ver_add] && $occt_ver_add != "" } {
|
||||
set occt_ver ${occt_ver}.$occt_ver_add
|
||||
}
|
||||
}
|
||||
} err]} {
|
||||
puts "Warning: Error reading version from $filename: $err"
|
||||
}
|
||||
} else {
|
||||
puts "Warning: Version file $filename not found or not readable"
|
||||
}
|
||||
|
||||
return $occt_ver
|
||||
}
|
||||
|
||||
# Checks if the necessary tools exist
|
||||
proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH PDFLATEX_PATH } {
|
||||
|
||||
upvar 1 DOXYGEN_PATH doxy_path
|
||||
upvar 1 GRAPHVIZ_PATH graph_path
|
||||
upvar 1 INKSCAPE_PATH inkscape_path
|
||||
upvar 1 HHC_PATH hhc_path
|
||||
upvar 1 PDFLATEX_PATH latex_path
|
||||
|
||||
set doxy_path ""
|
||||
set graph_path ""
|
||||
set inkscape_path ""
|
||||
set latex_path ""
|
||||
set hhc_path ""
|
||||
|
||||
set is_win "no"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set is_win "yes"
|
||||
}
|
||||
if {"$is_win" == "yes"} {
|
||||
set exe ".exe"
|
||||
set com ".com"
|
||||
} else {
|
||||
set exe ""
|
||||
set com ""
|
||||
}
|
||||
|
||||
set g_flag "no"
|
||||
set d_flag "no"
|
||||
set i_flag "no"
|
||||
set h_flag "no"
|
||||
set l_flag "no"
|
||||
|
||||
puts ""
|
||||
set envPath $::env(PATH)
|
||||
if { $is_win == "yes" } {
|
||||
set searchPathsList [split $envPath ";"]
|
||||
} else {
|
||||
set searchPathsList [split $envPath ":"]
|
||||
}
|
||||
|
||||
foreach path $searchPathsList {
|
||||
if { ($is_win == "no") &&
|
||||
(($path == "/usr/bin") || ($path == "/usr/local/bin")) } {
|
||||
# Avoid searching in default bin location
|
||||
continue
|
||||
}
|
||||
if {$d_flag == "no"} {
|
||||
if { [file exists $path/doxygen$exe] } {
|
||||
catch { exec $path/doxygen -V } version_string
|
||||
set version [lindex [split $version_string "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set doxy_path "$path/doxygen$exe"
|
||||
set d_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$g_flag == "no"} {
|
||||
if { [file exists $path/dot$exe] } {
|
||||
catch { exec $path/dot -V } version
|
||||
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set graph_path "$path/dot$exe"
|
||||
set g_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$i_flag == "no"} {
|
||||
if { [file exists $path/inkscape$com] } {
|
||||
catch { exec $path/inkscape -V } version
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set inkscape_path "$path/inkscape$com"
|
||||
set i_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$l_flag == "no"} {
|
||||
if { [file exists $path/pdflatex$exe] } {
|
||||
catch { exec $path/pdflatex -version } version
|
||||
set version [lindex [split $version "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set latex_path "$path/pdflatex$exe"
|
||||
set l_flag "yes"
|
||||
}
|
||||
}
|
||||
if { ("$is_win" == "yes") && ($h_flag == "no") } {
|
||||
if { [file exists $path/hhc.exe] } {
|
||||
puts "Info: hhc "
|
||||
puts " found in $path."
|
||||
set hhc_path "hhc$exe"
|
||||
set h_flag "yes"
|
||||
}
|
||||
}
|
||||
if { ($d_flag == "yes") &&
|
||||
($i_flag == "yes") &&
|
||||
($g_flag == "yes") &&
|
||||
($l_flag == "yes") &&
|
||||
(($is_win == "yes") &&
|
||||
($h_flag == "yes")) } {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# On Windows search for hhc.exe in the default location
|
||||
# if it has not been found yet
|
||||
if { ("$is_win" == "yes") && ($h_flag == "no") } {
|
||||
if { [info exists ::env(ProgramFiles\(x86\))] } {
|
||||
set h_flag "yes"
|
||||
set path "$::env(ProgramFiles\(x86\))\\HTML Help Workshop"
|
||||
set hhc_path "$path\\hhc.exe"
|
||||
puts "Info: hhc "
|
||||
puts " found in $path."
|
||||
} else {
|
||||
if { [info exists ::env(ProgramFiles)] } {
|
||||
set h_flag "yes"
|
||||
set path "$::env(ProgramFiles)\\HTML Help Workshop"
|
||||
set hhc_path "$path\\hhc.exe"
|
||||
puts "Info: hhc"
|
||||
puts " found in $path."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# On *nix-like platforms,
|
||||
# check the default binary locations if the tools had not been found yet
|
||||
if { $is_win == "no" &&
|
||||
(($d_flag == "no") ||
|
||||
($i_flag == "no") ||
|
||||
($g_flag == "no") ||
|
||||
($l_flag == "no")) } {
|
||||
|
||||
set default_path { "/usr/bin" "/usr/local/bin" }
|
||||
foreach path $default_path {
|
||||
if {$d_flag == "no"} {
|
||||
if { [file exists $path/doxygen$exe] } {
|
||||
catch { exec $path/doxygen -V } version_string
|
||||
set version [lindex [split $version_string "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set doxy_path "$path/doxygen$exe"
|
||||
set d_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$g_flag == "no"} {
|
||||
if { [file exists $path/dot$exe] } {
|
||||
catch { exec $path/dot -V } version
|
||||
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set graph_path "$path/dot$exe"
|
||||
set g_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$i_flag == "no"} {
|
||||
if { [file exists $path/inkscape$exe] } {
|
||||
catch { exec $path/inkscape -V } version
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set inkscape_path "$path/inkscape$exe"
|
||||
set i_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$l_flag == "no"} {
|
||||
if { [file exists $path/pdflatex$exe] } {
|
||||
catch { exec $path/pdflatex -version } version
|
||||
set version [lindex [split $version "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set latex_path "$path/pdflatex$exe"
|
||||
set l_flag "yes"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Check if tools have been found
|
||||
if { $d_flag == "no" } {
|
||||
puts "Warning: Could not find doxygen installed."
|
||||
return -1
|
||||
}
|
||||
if { $g_flag == "no" } {
|
||||
puts "Warning: Could not find graphviz installed."
|
||||
}
|
||||
if { $i_flag == "no" } {
|
||||
puts "Warning: Could not find inkscape installed."
|
||||
}
|
||||
if { $l_flag == "no" } {
|
||||
puts "Warning: Could not find pdflatex installed."
|
||||
}
|
||||
if { ("$::tcl_platform(platform)" == "windows") && ($h_flag == "no") } {
|
||||
puts "Warning: Could not find hhc installed."
|
||||
}
|
||||
|
||||
puts ""
|
||||
}
|
||||
|
||||
# Convert SVG files to PDF format to allow including them to PDF
|
||||
# (requires InkScape to be in PATH)
|
||||
proc OCCDoc_ProcessSvg {latexDir verboseMode} {
|
||||
set anSvgList [glob -nocomplain $latexDir/*.svg]
|
||||
if { $anSvgList == {} } {
|
||||
return
|
||||
}
|
||||
|
||||
catch { exec inkscape -V } anInkVer
|
||||
set isOldSyntax 0
|
||||
if {[string match "Inkscape 0.*" $anInkVer]} { set isOldSyntax 1 }
|
||||
foreach file $anSvgList {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Converting file $file..."
|
||||
}
|
||||
set pdffile "[file rootname $file].pdf"
|
||||
if { $isOldSyntax == 1 } {
|
||||
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
|
||||
#puts "Error: $res."
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if { [catch {exec inkscape $file --export-area-drawing --export-type=pdf --export-filename=$pdffile} res] } {
|
||||
#puts "Error: $res."
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ==============================================
|
||||
# Reference Manual-specific functions
|
||||
# ==============================================
|
||||
|
||||
# Finds dependencies between all modules
|
||||
proc OCCDoc_CreateModulesDependencyGraph {dir filename modules mpageprefix} {
|
||||
global module_dependency
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
foreach mod $modules {
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
puts $file "\t$mod \[ URL = \"[string tolower $mpageprefix$mod.html]\" \]"
|
||||
foreach mod_depend $module_dependency($mod) {
|
||||
puts $file "\t$mod_depend -> $mod \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Finds dependencies between all toolkits in module
|
||||
proc OCCDoc_CreateModuleToolkitsDependencyGraph {dir filename modulename tpageprefix} {
|
||||
global toolkits_in_module
|
||||
global toolkit_dependency
|
||||
global toolkit_parent_module
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
foreach tk $toolkits_in_module($modulename) {
|
||||
puts $file "\t$tk \[ URL = \"[string tolower $tpageprefix$tk.html]\"\ ]"
|
||||
foreach tkd $toolkit_dependency($tk) {
|
||||
if { [info exists toolkit_parent_module($tkd)] } {
|
||||
if {$toolkit_parent_module($tkd) == $modulename} {
|
||||
puts $file "\t$tkd -> $tk \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Finds dependencies between the current toolkit and other toolkits
|
||||
proc OCCDoc_CreateToolkitDependencyGraph {dir filename toolkitname tpageprefix} {
|
||||
global toolkit_dependency
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
puts $file "\t$toolkitname \[ URL = \"[string tolower $tpageprefix$toolkitname.html]\"\, shape = box ]"
|
||||
foreach tkd $toolkit_dependency($toolkitname) {
|
||||
puts $file "\t$tkd \[ URL = \"[string tolower $tpageprefix$tkd.html]\"\ , shape = box ]"
|
||||
puts $file "\t$toolkitname -> $tkd \[ color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
|
||||
if {[llength $toolkit_dependency($toolkitname)] > 1} {
|
||||
puts $file "\taspect = 1"
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Fills arrays of modules, toolkits, dependency of modules/toolkits etc
|
||||
proc OCCDoc_LoadData { {theProductsDir ""} } {
|
||||
global toolkits_in_module
|
||||
global toolkit_dependency
|
||||
global toolkit_parent_module
|
||||
global module_dependency
|
||||
|
||||
if { $theProductsDir == ""} {
|
||||
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/OS/" *.tcl]
|
||||
} else {
|
||||
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/VAS/" *.tcl]
|
||||
}
|
||||
|
||||
foreach module_file $modules_files {
|
||||
source $module_file
|
||||
}
|
||||
|
||||
set modules [OCCDoc_GetModulesList $theProductsDir]
|
||||
foreach mod $modules {
|
||||
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
# Get toolkits of current module
|
||||
set toolkits_in_module($mod) [$mod:toolkits]
|
||||
# Get all dependence of current toolkit
|
||||
foreach tk $toolkits_in_module($mod) {
|
||||
# set parent module of current toolkit
|
||||
set toolkit_parent_module($tk) $mod
|
||||
set exlibfile [open "[OCCDoc_GetSourceDir $theProductsDir]/$tk/EXTERNLIB" r]
|
||||
set exlibfile_data [read $exlibfile]
|
||||
set exlibfile_data [split $exlibfile_data "\n"]
|
||||
|
||||
set toolkit_dependency($tk) {}
|
||||
foreach dtk $exlibfile_data {
|
||||
if { ([string first "TK" $dtk 0] == 0) ||
|
||||
([string first "P" $dtk 0] == 0) } {
|
||||
lappend toolkit_dependency($tk) $dtk
|
||||
}
|
||||
}
|
||||
close $exlibfile
|
||||
}
|
||||
}
|
||||
|
||||
# Get modules dependency
|
||||
foreach mod $modules {
|
||||
set module_dependency($mod) {}
|
||||
foreach tk $toolkits_in_module($mod) {
|
||||
foreach tkd $toolkit_dependency($tk) {
|
||||
if { [info exists toolkit_parent_module($tkd)] } {
|
||||
if { $toolkit_parent_module($tkd) != $mod &&
|
||||
[lsearch $module_dependency($mod) $toolkit_parent_module($tkd)] == -1} {
|
||||
lappend module_dependency($mod) $toolkit_parent_module($tkd)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Returns list of packages of the given toolkit
|
||||
proc OCCDoc_GetPackagesList { theToolKitPath } {
|
||||
|
||||
set packages_list {}
|
||||
|
||||
# Open file with list of packages of the given toolkit
|
||||
set fileid [open "$theToolKitPath/PACKAGES" "r"]
|
||||
|
||||
while { [eof $fileid] == 0 } {
|
||||
set str [gets $fileid]
|
||||
if { $str != "" } {
|
||||
lappend packages_list $str
|
||||
}
|
||||
}
|
||||
|
||||
close $fileid
|
||||
|
||||
return $packages_list
|
||||
}
|
||||
|
||||
# Returns list of modules from UDLIST
|
||||
proc OCCDoc_GetModulesList { {theProductsDir ""} } {
|
||||
|
||||
if { $theProductsDir == "" } {
|
||||
source "[OCCDoc_GetSourceDir $theProductsDir]/OS/Modules.tcl"
|
||||
# load a command from this file
|
||||
set modules [OS:Modules]
|
||||
} else {
|
||||
source "[OCCDoc_GetSourceDir $theProductsDir]/VAS/Products.tcl"
|
||||
# load a command from this file
|
||||
set modules [VAS:Products]
|
||||
set modules [lsearch -not -all -inline $modules "VAS"]
|
||||
}
|
||||
|
||||
return $modules
|
||||
}
|
||||
|
||||
# Returns list of desired files in the specified location
|
||||
proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
|
||||
|
||||
# Get list of header files with path
|
||||
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
|
||||
|
||||
# Get content according to desired type ('p' for path and 'f' for filenames only)
|
||||
if { $theDesiredContent == "p" } {
|
||||
return $files_list
|
||||
} elseif { $theDesiredContent == "f" } {
|
||||
|
||||
# Cut paths from filenames
|
||||
foreach file $files_list {
|
||||
set elem_index [lsearch $files_list $file]
|
||||
lset files_list $elem_index [OCCDoc_GetNameFromPath [lindex $files_list $elem_index]]
|
||||
}
|
||||
return $files_list
|
||||
}
|
||||
}
|
||||
|
||||
# Returns location of the toolkit
|
||||
proc OCCDoc_Locate { theToolKitName {theProductsDir ""} } {
|
||||
set tk_dir "[OCCDoc_GetSourceDir $theProductsDir]/[OCCDoc_GetNameFromPath $theToolKitName]"
|
||||
return $tk_dir
|
||||
}
|
||||
|
||||
# Gets contents of the given html node (for Post-processing)
|
||||
proc OCCDoc_GetNodeContents {node props html} {
|
||||
set openTag "<$node$props>"
|
||||
set closingTag "</$node>"
|
||||
set start [string first $openTag $html]
|
||||
if {$start == -1} {
|
||||
return ""
|
||||
}
|
||||
set start [expr $start + [string length $openTag]]
|
||||
set end [string length $html]
|
||||
set html [string range $html $start $end]
|
||||
set start [string first $closingTag $html]
|
||||
set end [string length $html]
|
||||
if {$start == -1} {
|
||||
return ""
|
||||
}
|
||||
set start [expr $start - 1]
|
||||
return [string range $html 0 $start]
|
||||
}
|
||||
|
||||
# Generates main page file describing module structure
|
||||
proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
|
||||
global env
|
||||
|
||||
set one_module [expr [llength $modules] == 1]
|
||||
set fd [open $outFile "w"]
|
||||
|
||||
set module_prefix "module_"
|
||||
set toolkit_prefix "toolkit_"
|
||||
set package_prefix "package_"
|
||||
|
||||
if { ! [file exists "$outDir/html"] } {
|
||||
file mkdir "$outDir/html"
|
||||
}
|
||||
|
||||
OCCDoc_LoadData $theProductsDir
|
||||
|
||||
# Main page: list of modules
|
||||
if { ! $one_module } {
|
||||
puts $fd "/**"
|
||||
puts $fd "\\mainpage Open CASCADE Technology"
|
||||
|
||||
foreach mod $modules {
|
||||
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
|
||||
}
|
||||
# insert modules relationship diagram
|
||||
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per module: list of toolkits
|
||||
set toolkits {}
|
||||
foreach mod $modules {
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
puts $fd "/**"
|
||||
if { $one_module } {
|
||||
puts $fd "\\mainpage OCCT Module [$mod:name]"
|
||||
} else {
|
||||
puts $fd "\\page [string tolower module_$mod] Module [$mod:name]"
|
||||
}
|
||||
foreach tk [lsort [$mod:toolkits]] {
|
||||
lappend toolkits $tk
|
||||
puts $fd "\\li \\subpage [string tolower $toolkit_prefix$tk]"
|
||||
}
|
||||
puts $fd "\\dotfile [OCCDoc_CreateModuleToolkitsDependencyGraph $outDir/html schema_$mod $mod $toolkit_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per toolkit: list of packages
|
||||
set packages {}
|
||||
foreach tk $toolkits {
|
||||
puts $fd "/**"
|
||||
puts $fd "\\page [string tolower toolkit_$tk] Toolkit $tk"
|
||||
foreach pk [lsort [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $theProductsDir]]] {
|
||||
lappend packages $pk
|
||||
set u [OCCDoc_GetNameFromPath $pk]
|
||||
puts $fd "\\li \\subpage [string tolower $package_prefix$u]"
|
||||
}
|
||||
puts $fd "\\dotfile [OCCDoc_CreateToolkitDependencyGraph $outDir/html schema_$tk $tk $toolkit_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per package: list of classes
|
||||
foreach pk $packages {
|
||||
set u [OCCDoc_GetNameFromPath $pk]
|
||||
puts $fd "/**"
|
||||
puts $fd "\\page [string tolower $package_prefix$u] Package $u"
|
||||
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "$pk" "$theProductsDir"]] {
|
||||
if { ! [regexp {^Handle_} $hdr] && [regexp {(.*)[.]hxx} $hdr str obj] } {
|
||||
puts $fd "\\li \\subpage $obj"
|
||||
}
|
||||
}
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
close $fd
|
||||
|
||||
return $outFile
|
||||
}
|
||||
|
||||
# Parses generated files to add a navigation path
|
||||
proc OCCDoc_PostProcessor {outDir} {
|
||||
puts "[clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Post-process is started ..."
|
||||
append outDir "/html"
|
||||
set files [glob -nocomplain -type f $outDir/package_*]
|
||||
if { $files != {} } {
|
||||
foreach f [lsort $files] {
|
||||
set packageFilePnt [open $f r]
|
||||
set packageFile [read $packageFilePnt]
|
||||
set navPath [OCCDoc_GetNodeContents "div" " id=\"nav-path\" class=\"navpath\"" $packageFile]
|
||||
set packageName [OCCDoc_GetNodeContents "div" " class=\"title\"" $packageFile]
|
||||
regsub -all {<[^<>]*>} $packageName "" packageName
|
||||
|
||||
# add package link to nav path
|
||||
set first [expr 1 + [string last "/" $f]]
|
||||
set last [expr [string length $f] - 1]
|
||||
set packageFileName [string range $f $first $last]
|
||||
set end [string first "</ul>" $navPath]
|
||||
set end [expr $end - 1]
|
||||
set navPath [string range $navPath 0 $end]
|
||||
append navPath " <li class=\"navelem\"><a class=\"el\" href=\"$packageFileName\">$packageName</a> </li>\n </ul>"
|
||||
|
||||
# get list of files to update
|
||||
set listContents [OCCDoc_GetNodeContents "div" " class=\"textblock\"" $packageFile]
|
||||
set listContents [OCCDoc_GetNodeContents "ul" "" $listContents]
|
||||
set lines [split $listContents "\n"]
|
||||
foreach line $lines {
|
||||
if {[regexp {href=\"([^\"]*)\"} $line tmpLine classFileName]} {
|
||||
# check if anchor is there
|
||||
set anchorPos [string first "#" $classFileName]
|
||||
if {$anchorPos != -1} {
|
||||
set classFileName [string range $classFileName 0 [expr $anchorPos - 1]]
|
||||
}
|
||||
|
||||
# read class file
|
||||
set classFilePnt [open $outDir/$classFileName r+]
|
||||
set classFile [read $classFilePnt]
|
||||
|
||||
# find position of content block
|
||||
set contentPos [string first "<div class=\"header\">" $classFile]
|
||||
set navPart [string range $classFile 0 [expr $contentPos - 1]]
|
||||
|
||||
# position where to insert nav path
|
||||
set posToInsert [string last "</div>" $navPart]
|
||||
set prePart [string range $classFile 0 [expr $posToInsert - 1]]
|
||||
set postPart [string range $classFile $posToInsert [string length $classFile]]
|
||||
set newClassFile ""
|
||||
append newClassFile $prePart " <div id=\"nav-path\" class=\"navpath\">" $navPath \n " </div>" \n $postPart
|
||||
|
||||
# write updated content
|
||||
seek $classFilePnt 0
|
||||
puts $classFilePnt $newClassFile
|
||||
close $classFilePnt
|
||||
}
|
||||
}
|
||||
close $packageFilePnt
|
||||
}
|
||||
return 0
|
||||
} else {
|
||||
puts "no files found"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
# ======================================
|
||||
# User Guides-specific functions
|
||||
# ======================================
|
||||
|
||||
# Loads a list of docfiles from file FILES.txt
|
||||
proc OCCDoc_LoadFilesList {} {
|
||||
set INPUTDIR [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
|
||||
|
||||
global available_docfiles
|
||||
set available_docfiles {}
|
||||
|
||||
# Read data from file
|
||||
if { [file exists "$INPUTDIR/FILES_HTML.txt"] == 1 } {
|
||||
set FILE [open "$INPUTDIR/FILES_HTML.txt" r]
|
||||
while {1} {
|
||||
set line [string trim [gets $FILE]]
|
||||
|
||||
# trim possible comments starting with '#'
|
||||
set line [regsub {\#.*} $line {}]
|
||||
if {$line != ""} {
|
||||
lappend available_docfiles $line
|
||||
}
|
||||
if {[eof $FILE]} {
|
||||
close $FILE
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
|
||||
global available_pdf
|
||||
set available_pdf {}
|
||||
|
||||
# Read data from file
|
||||
if { [file exists "$INPUTDIR/FILES_PDF.txt"] } {
|
||||
set FILE [open "$INPUTDIR/FILES_PDF.txt" r]
|
||||
while {1} {
|
||||
set line [string trim [gets $FILE]]
|
||||
|
||||
# Trim possible comments starting with '#'
|
||||
set line [regsub {\#.*} $line {}]
|
||||
if {$line != ""} {
|
||||
lappend available_pdf $line
|
||||
}
|
||||
if {[eof $FILE]} {
|
||||
close $FILE
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Writes new TeX file for conversion from tex to pdf for a specific doc
|
||||
proc OCCDoc_MakeRefmanTex {fileName latexDir verboseMode latexFilesList} {
|
||||
|
||||
if { $verboseMode == "YES" } {
|
||||
puts "Info: Making refman.tex file for $fileName..."
|
||||
}
|
||||
set DOCNAME "$latexDir/refman.tex"
|
||||
if {[file exists $DOCNAME] == 1} {
|
||||
file delete -force $DOCNAME
|
||||
}
|
||||
|
||||
# Copy template file to latex folder
|
||||
if { "[OCCDoc_GetProdRootDir]" != "" } {
|
||||
file copy "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex" $DOCNAME
|
||||
} else {
|
||||
file copy "[OCCDoc_GetDoxDir]/resources/occt_pdf_template.tex" $DOCNAME
|
||||
}
|
||||
|
||||
# Get templatized data
|
||||
set texfile [open $DOCNAME "r"]
|
||||
set texfile_loaded [read $texfile]
|
||||
close $texfile
|
||||
|
||||
# Replace dummy values
|
||||
set year [clock format [clock seconds] -format {%Y}]
|
||||
set month [clock format [clock seconds] -format {%B}]
|
||||
set texfile [open $DOCNAME "w"]
|
||||
set casVersion [OCCDoc_DetectCasVersion]
|
||||
|
||||
# Get name of the document
|
||||
set docLabel ""
|
||||
foreach aFileName $latexFilesList {
|
||||
# Find the file in FILES_PDF.txt
|
||||
set parsedFileName [file rootname [lindex [split $aFileName "/" ] end]]
|
||||
if { [regexp "${parsedFileName}$" $fileName] } {
|
||||
set filepath "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/$aFileName"
|
||||
if { [file exists $filepath] } {
|
||||
set MDFile [open $filepath "r"]
|
||||
set label [split [gets $MDFile] "\{"]
|
||||
set docLabel [lindex $label 0]
|
||||
close $MDFile
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set occtlogo_path "[OCCDoc_GetDoxDir]/resources/occt_logo.png"
|
||||
set occlogo_path "[OCCDoc_GetDoxDir]/resources/occ_logo.png"
|
||||
set copyright_path "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex"
|
||||
set texfile_loaded [string map [list DEFDOCLABEL "$docLabel" DEFCASVERSION "$casVersion" DEFFILENAME "$fileName" DEFYEAR "$year" DEFMONTH "$month" DEFCOPYRIGHT "$copyright_path" DEFLOGO "$occtlogo_path" DEFOCCLOGO "$occlogo_path" DEFTITLE ""] $texfile_loaded]
|
||||
|
||||
# Get data
|
||||
puts $texfile $texfile_loaded
|
||||
|
||||
close $texfile
|
||||
}
|
||||
|
||||
# Postprocesses generated TeX files
|
||||
proc OCCDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
|
||||
|
||||
foreach TEX $texFiles {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Preprocessing file $TEX..."
|
||||
}
|
||||
|
||||
if {![file exists $TEX]} {
|
||||
puts "Error: file $TEX does not exist."
|
||||
return -1
|
||||
}
|
||||
|
||||
set IN_F [open "$TEX" "r"]
|
||||
set TMPFILENAME "$latexDir/temp.tex"
|
||||
set OUT_F [open $TMPFILENAME w]
|
||||
|
||||
while {1} {
|
||||
set line [gets $IN_F]
|
||||
if { [string first "\\includegraphics" $line] != -1 } {
|
||||
# replace svg extension by pdf
|
||||
set line [regsub {[.]svg} $line ".pdf"]
|
||||
# Center images in TeX files
|
||||
set line "\\begin{center}\n $line\n\\end{center}"
|
||||
} elseif { [string first "\\subsection" $line] != -1 } {
|
||||
# Replace \subsection with \section tag
|
||||
regsub -all "\\\\subsection" $line "\\\\section" line
|
||||
} elseif { [string first "\\subsubsection" $line] != -1 } {
|
||||
# Replace \subsubsection with \subsection tag
|
||||
regsub -all "\\\\subsubsection" $line "\\\\subsection" line
|
||||
} elseif { [string first "\\paragraph" $line] != -1 } {
|
||||
# Replace \paragraph with \subsubsection tag
|
||||
regsub -all "\\\\paragraph" $line "\\\\subsubsection" line
|
||||
}
|
||||
puts $OUT_F $line
|
||||
|
||||
if {[eof $IN_F]} {
|
||||
close $IN_F
|
||||
close $OUT_F
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
file delete -force $TEX
|
||||
file rename $TMPFILENAME $TEX
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
#!/usr/bin/tclsh
|
||||
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
if { [llength $argv] < 1 } {
|
||||
puts "Command-line starter for Tcl command defined in same-named file."
|
||||
puts "Use it as follows:"
|
||||
puts "\> tclsh start.tcl command \[arguments\]"
|
||||
return
|
||||
}
|
||||
|
||||
set cmdname [lindex $argv 0]
|
||||
source [file join [file dirname [info script]] $cmdname.tcl]
|
||||
|
||||
eval $cmdname [lrange $argv 1 end]
|
@ -47,6 +47,9 @@ ENUM_VALUES_PER_LINE = 8
|
||||
TREEVIEW_WIDTH = 250
|
||||
EXTERNAL_PAGES = NO
|
||||
SEARCHDATA_FILE = searchdata.xml
|
||||
SERVER_BASED_SEARCH = NO
|
||||
SEARCHENGINE = YES
|
||||
EXTERNAL_SEARCH = YES
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
FORMULA_FONTSIZE = 12
|
||||
FORMULA_TRANSPARENT = YES
|
||||
|
@ -1,64 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc ApplicationFramework:toolkits { } {
|
||||
return [list \
|
||||
TKCDF \
|
||||
TKLCAF \
|
||||
TKVCAF \
|
||||
TKCAF \
|
||||
TKBinL \
|
||||
TKXmlL \
|
||||
TKBin \
|
||||
TKXml \
|
||||
TKStdL \
|
||||
TKStd \
|
||||
TKTObj \
|
||||
TKBinTObj \
|
||||
TKXmlTObj \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc ApplicationFramework:ressources { } {
|
||||
return [list \
|
||||
[list both r StdResource {}] \
|
||||
[list both r XmlOcafResource {}] \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc ApplicationFramework:name { } {
|
||||
return ApplicationFramework
|
||||
}
|
||||
;#
|
||||
;# Short Nom du module ( 3 lettres )
|
||||
;#
|
||||
proc ApplicationFramework:alias { } {
|
||||
return CAF
|
||||
}
|
||||
proc ApplicationFramework:depends { } {
|
||||
return [list Visualization]
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc ApplicationFramework:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc DataExchange:toolkits { } {
|
||||
return [list TKXSBase TKXCAF TKDEIGES TKDESTEP \
|
||||
TKDE TKDECascade TKDESTL TKDEVRML \
|
||||
TKXmlXCAF TKBinXCAF TKRWMesh \
|
||||
TKDEGLTF TKDEOBJ TKDEPLY]
|
||||
}
|
||||
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc DataExchange:ressources { } {
|
||||
return [list \
|
||||
[list both r XSMessage {} ] \
|
||||
[list both r SHMessage {} ] \
|
||||
[list both r XSTEPResource {} ] \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# retourne une liste de triplets {type <full path1> <target directory>/name}
|
||||
;# permet de faire : cp <full path> $CASROOT/<target directory>/name
|
||||
;# On peut ainsi embarquer des fichiers d'un peu partout et les dispatcher sous
|
||||
;# la racine d'arrivee et ce avec un autre nom.
|
||||
;# rien n'empeche de CALCULER automatiquement des paths dans cette proc.
|
||||
;# type = source/runtime/both pour dire si le fichier va dans l'archive en question.
|
||||
;# une deux (ou les deux) type d'archive fabriquees.
|
||||
;#
|
||||
proc DataExchange:freefiles { } {
|
||||
return {}
|
||||
}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc DataExchange:name { } {
|
||||
return DataExchange
|
||||
}
|
||||
proc DataExchange:alias { } {
|
||||
return DXE
|
||||
}
|
||||
proc DataExchange:depends { } {
|
||||
return [list ApplicationFramework]
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc DataExchange:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;# Return list of toolkits
|
||||
proc Draw:toolkits { } {
|
||||
set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
|
||||
|
||||
lappend aResult "TKOpenGlTest"
|
||||
if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
|
||||
lappend aResult "TKOpenGlesTest"
|
||||
}
|
||||
|
||||
if { [info exists ::env(HAVE_D3D)] } {
|
||||
if { "$::env(HAVE_D3D)" == "true" } {
|
||||
lappend aResult "TKD3DHostTest"
|
||||
}
|
||||
}
|
||||
|
||||
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
|
||||
lappend aResult "TKIVtkDraw"
|
||||
}
|
||||
|
||||
return $aResult
|
||||
}
|
||||
|
||||
;# Autres UDs a prendre. Listes de triplets
|
||||
;# { ar typ UD str } Tous les types de UD vont dans un sous directory nomme root/str
|
||||
;# Ils seront dans CAS3.0/str de l'archive de type ar (source/runtime)
|
||||
;# { ar typ UD {} } Tous les types de UD vont dans root/UD/src => CAS3.0/src
|
||||
proc Draw:ressources { } {
|
||||
return [list \
|
||||
[list both r DrawResources {}] \
|
||||
[list both x DRAWEXE {}] \
|
||||
]
|
||||
}
|
||||
|
||||
proc Draw:freefiles { } { return {} }
|
||||
|
||||
proc Draw:name { } { return Draw }
|
||||
proc Draw:alias { } { return DRAW }
|
||||
proc Draw:depends { } { return [list DataExchange] }
|
||||
proc Draw:acdepends { } { return [list TCLTK] }
|
||||
|
||||
;# Returns a list of exported features.
|
||||
proc Draw:Export { } { return [list source runtime wokadm api] }
|
@ -1,8 +0,0 @@
|
||||
srcinc:::ApplicationFramework.tcl
|
||||
srcinc:::DataExchange.tcl
|
||||
srcinc:::Draw.tcl
|
||||
srcinc:::FoundationClasses.tcl
|
||||
srcinc:::ModelingAlgorithms.tcl
|
||||
srcinc:::ModelingData.tcl
|
||||
srcinc:::Modules.tcl
|
||||
srcinc:::Visualization.tcl
|
@ -1,62 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc FoundationClasses:toolkits { } {
|
||||
return [list TKernel TKMath]
|
||||
}
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc FoundationClasses:ressources { } {
|
||||
return [list \
|
||||
[list both r OS {} ] \
|
||||
[list both r UnitsAPI {} ] \
|
||||
]
|
||||
}
|
||||
;
|
||||
;#
|
||||
;# retourne une liste de triplets {type <full path1> <target directory>/name}
|
||||
;# permet de faire : cp <full path> $CASROOT/<target directory>/name
|
||||
;# On peut ainsi embarquer des fichiers d'un peu partout et les dispatcher sous
|
||||
;# la racine d'arrivee et ce avec un autre nom.
|
||||
;# rien n'empeche de CALCULER automatiquement des paths dans cette proc.
|
||||
;# type = source/runtime/both pour dire si le fichier va dans l'archive en question.
|
||||
;# une deux (ou les deux) type d'archive fabriquees.
|
||||
;#
|
||||
proc FoundationClasses:freefiles { } {}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc FoundationClasses:name { } {
|
||||
return FoundationClasses
|
||||
}
|
||||
proc FoundationClasses:alias { } {
|
||||
return FOC
|
||||
}
|
||||
proc FoundationClasses:depends { } {
|
||||
return {}
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc FoundationClasses:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
||||
|
||||
proc FoundationClasses:install { } {
|
||||
return [list UnitsAPI]
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc ModelingAlgorithms:toolkits { } {
|
||||
return [list TKGeomAlgo \
|
||||
TKTopAlgo \
|
||||
TKPrim \
|
||||
TKBO \
|
||||
TKBool \
|
||||
TKHLR \
|
||||
TKFillet \
|
||||
TKOffset \
|
||||
TKFeat \
|
||||
TKMesh \
|
||||
TKXMesh \
|
||||
TKShHealing \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc ModelingAlgorithms:ressources { } {
|
||||
|
||||
}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc ModelingAlgorithms:name { } {
|
||||
return ModelingAlgorithms
|
||||
}
|
||||
proc ModelingAlgorithms:alias { } {
|
||||
return ALGO
|
||||
}
|
||||
proc ModelingAlgorithms:depends { } {
|
||||
return [list ModelingData]
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc ModelingAlgorithms:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc ModelingData:toolkits { } {
|
||||
return [list TKG2d \
|
||||
TKG3d \
|
||||
TKGeomBase \
|
||||
TKBRep \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc ModelingData:ressources { } {
|
||||
|
||||
}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc ModelingData:name { } {
|
||||
return ModelingData
|
||||
}
|
||||
proc ModelingData:alias { } {
|
||||
return DATA
|
||||
}
|
||||
proc ModelingData:depends { } {
|
||||
return [list FoundationClasses]
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc ModelingData:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Retourne la liste ordonnee des noms de Modules
|
||||
;#
|
||||
proc OS:Modules { {plat ""} } {
|
||||
set ret [list FoundationClasses \
|
||||
ModelingData \
|
||||
ModelingAlgorithms \
|
||||
Visualization \
|
||||
ApplicationFramework \
|
||||
DataExchange \
|
||||
Draw \
|
||||
]
|
||||
return $ret
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
# Copyright (c) 2020 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# List of toolkits
|
||||
proc TApplicationFramework:toolkits { } {
|
||||
return [list TKTreeModel TKTInspectorAPI TKDFBrowser]
|
||||
}
|
||||
|
||||
# List of non-toolkits (resource units, executables etc., with associated info)
|
||||
proc TApplicationFramework:ressources { } {
|
||||
}
|
||||
|
||||
# Module name
|
||||
proc TApplicationFramework:name { } {
|
||||
return TApplicationFramework
|
||||
}
|
||||
|
||||
# And short alias
|
||||
proc TApplicationFramework:alias { } {
|
||||
return TApplicationFramework
|
||||
}
|
||||
|
||||
# Dependency on other products
|
||||
proc TApplicationFramework:depends { } {
|
||||
return [list ApplicationFramework FoundationClasses DataExchange TModelingData Visualization]
|
||||
}
|
||||
|
||||
# Returns a list of exported features.
|
||||
proc TApplicationFramework:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
# Copyright (c) 2020 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# List of toolkits
|
||||
proc TModelingData:toolkits { } {
|
||||
return [list TKShapeView]
|
||||
}
|
||||
|
||||
# List of non-toolkits (resource units, executables etc., with associated info)
|
||||
proc TModelingData:ressources { } {
|
||||
}
|
||||
|
||||
# Module name
|
||||
proc TModelingData:name { } {
|
||||
return TModelingData
|
||||
}
|
||||
|
||||
# And short alias
|
||||
proc TModelingData:alias { } {
|
||||
return TModelingData
|
||||
}
|
||||
|
||||
# Dependency on other products
|
||||
proc TModelingData:depends { } {
|
||||
return [list FoundationClasses ModelingData TVisualization]
|
||||
}
|
||||
|
||||
# Returns a list of exported features.
|
||||
proc TModelingData:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
# Copyright (c) 2020 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# List of toolkits
|
||||
proc TTool:toolkits { } {
|
||||
return [list TKTInspector TKToolsDraw]
|
||||
}
|
||||
|
||||
# List of non-toolkits (resource units, executables etc., with associated info)
|
||||
proc TTool:ressources { } {
|
||||
return [list \
|
||||
[list both x TInspectorEXE {}] \
|
||||
]
|
||||
}
|
||||
|
||||
# Module name
|
||||
proc TTool:name { } {
|
||||
return TTool
|
||||
}
|
||||
|
||||
# And short alias
|
||||
proc TTool:alias { } {
|
||||
return TTool
|
||||
}
|
||||
|
||||
# Dependency on other products
|
||||
proc TTool:depends { } {
|
||||
return [list FoundationClasses Draw TApplicationFramework]
|
||||
}
|
||||
|
||||
# Returns a list of exported features.
|
||||
proc TTool:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
# Copyright (c) 2020 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
# List of toolkits
|
||||
proc TVisualization:toolkits { } {
|
||||
return [list TKView TKVInspector]
|
||||
}
|
||||
|
||||
# List of non-toolkits (resource units, executables etc., with associated info)
|
||||
proc TVisualization:ressources { } {
|
||||
}
|
||||
|
||||
# Module name
|
||||
proc TVisualization:name { } {
|
||||
return TVisualization
|
||||
}
|
||||
|
||||
# And short alias
|
||||
proc TVisualization:alias { } {
|
||||
return TVisualization
|
||||
}
|
||||
|
||||
# Dependency on other products
|
||||
proc TVisualization:depends { } {
|
||||
return [list FoundationClasses]
|
||||
}
|
||||
|
||||
# Returns a list of exported features.
|
||||
proc TVisualization:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
# Copyright (c) 2020 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Returns an ordered list of module names
|
||||
;#
|
||||
proc OS:Tools { {plat ""} } {
|
||||
set ret [list TModelingData \
|
||||
TVisualization \
|
||||
TApplicationFramework \
|
||||
TTool \
|
||||
]
|
||||
return $ret
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
# Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
#
|
||||
# This file is part of Open CASCADE Technology software library.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
# by the Free Software Foundation, with special exception defined in the file
|
||||
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
# distribution for complete text of the license and disclaimer of any warranty.
|
||||
#
|
||||
# Alternatively, this file may be used under the terms of Open CASCADE
|
||||
# commercial license or contractual agreement.
|
||||
|
||||
;#
|
||||
;# Liste des toolkits WOK sous forme de full path
|
||||
;#
|
||||
proc Visualization:toolkits { } {
|
||||
set aResult [list TKService TKV3d TKMeshVS]
|
||||
|
||||
lappend aResult "TKOpenGl"
|
||||
if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
|
||||
lappend aResult "TKOpenGles"
|
||||
}
|
||||
|
||||
if { [info exists ::env(HAVE_D3D)] } {
|
||||
if { "$::env(HAVE_D3D)" == "true" } {
|
||||
lappend aResult "TKD3DHost"
|
||||
}
|
||||
}
|
||||
|
||||
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
|
||||
lappend aResult "TKIVtk"
|
||||
}
|
||||
|
||||
return $aResult
|
||||
}
|
||||
|
||||
;#
|
||||
;# Autres UDs a prendre.
|
||||
;#
|
||||
proc Visualization:ressources { } {
|
||||
return [list \
|
||||
[list both r Textures {}] \
|
||||
[list both r Shaders {}] \
|
||||
[list both r XRResources {}] \
|
||||
]
|
||||
}
|
||||
;#
|
||||
;# Nom du module
|
||||
;#
|
||||
proc Visualization:name { } {
|
||||
return Visualization
|
||||
}
|
||||
proc Visualization:alias { } {
|
||||
return VIS
|
||||
}
|
||||
proc Visualization:depends { } {
|
||||
return [list ModelingAlgorithms]
|
||||
}
|
||||
|
||||
proc Visualization:acdepends { } {
|
||||
set aList [list X11 GL FREETYPE]
|
||||
|
||||
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
|
||||
lappend aList "VTK"
|
||||
}
|
||||
|
||||
return $aList
|
||||
}
|
||||
|
||||
;#
|
||||
;# Returns a list of exported features.
|
||||
;#
|
||||
proc Visualization:Export { } {
|
||||
return [list source runtime wokadm api]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user