View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0032280 | Community | OCCT:Application Framework | public | 2021-04-04 18:16 | 2021-09-03 14:10 |
| Reporter | Kou Ouchi | Assigned To | bugmaster | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Platform | Windows | OS | VC++ 2015 | ||
| Product Version | 7.5.0 | ||||
| Summary | 0032280: Application Framework - TDocStd_Application's Open() is blocked. | ||||
| Description | TDocStd_Application has 2 Open Methods as follows: 1)PCDM_ReaderStatus Open (const TCollection_ExtendedString& path, ...) 2)PCDM_ReaderStatus Open (Standard_IStream& theIStream Handle(TDocStd_Document)& theDoc, ...); "1)" is ok. But "2)" is blocked. Target file is same content. For referrence, my CMakeLists.txt is as follows:
===
cmake_minimum_required(VERSION 3.9.5)
project(xbf-stream LANGUAGES CXX)
set(OCCT_LIBS
TKernel
TKMath
TKG2d
TKG3d
TKGeomBase
TKBRep
TKGeomAlgo
TKTopAlgo
TKShHealing
TKMesh
TKXmlL
TKXml
TKVCAF
TKBinL
TKPrim
TKCDF
TKLCAF
TKCAF
TKBin
TKXSBase
TKBO
TKBool
TKIGES
TKSTEP
TKSTEPBase
TKSTEPAttr
TKSTEP209
TKService
TKHLR
TKV3d
TKOpenGl
TKXDESTEP
TKXDEIGES
TKXCAF
#TKXmlXCAF
TKBinXCAF
TKOffset
TKFillet
TKMeshVS
#TKXSDraw
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# include(GenerateExportHeader)
# Activate C++ exception handling
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF ()
IF (NOT CMAKE_CXX_FLAGS MATCHES "/MP")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF ()
IF (NOT CMAKE_CXX_FLAGS MATCHES "-Zm")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zm250")
ENDIF ()
IF (NOT CMAKE_CXX_FLAGS MATCHES "/GL")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL")
ENDIF ()
IF (NOT CMAKE_CXX_FLAGS MATCHES "/Gy")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Gy")
ENDIF ()
add_definitions(-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
#
# include and lib directory
#
include_directories(
$ENV{CSF_OCCTIncludePath}
)
link_directories(
$ENV{CSF_OCCTLibPath}
)
FILE(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cxx)
if(WIN32)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
endif(WIN32)
target_link_libraries(${PROJECT_NAME}
freetype
${OCCT_LIBS}
)
if(WIN32)
target_link_libraries(${PROJECT_NAME}
opengl32
)
endif(WIN32)
| ||||
| Steps To Reproduce | Not required | ||||
| Tags | No tags attached. | ||||
| Test case number | |||||
|
|
|
main.cxx (4,078 bytes) |
|
|
std::ifstream filestream("test.xbf", std::ifstream::in);
Are you sure you want to open a binary (XBF) file as a text stream? |
|
|
Binary stream is returned normaly. I'm sure that my test code was bugged. Thank you for reply. |
|
|
I confirm that the following change: std::ifstream filestream("test.xbf", std::ifstream::in | std::ifstream::binary); makes reading of stream work fine. Also, I may notice that app->NewDocument("BinXCAF", doc); last two times (before document or stream open) is not needed - the "Open" creates document anyway. And to make the "main.cxx" example working two methods "read_from_file" and "read_from_stream" must get document arguments by reference: Handle(TDocStd_Document)& _doc because after this method call and document is opened this variable must be updated also at the method-caller side. However the original problem is outside of OCCT, so I will close this issue. |
|
|
Dear bugmaster, please close this issue. |
|
|
Hi, Thank you for your reply. I understood your issues. |
|
|
Dear bugmaster, could you close this issue. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2021-04-04 18:16 | Kou Ouchi | New Issue | |
| 2021-04-04 18:16 | Kou Ouchi | Assigned To | => mpv |
| 2021-04-04 18:16 | Kou Ouchi | File Added: main.cxx | |
| 2021-04-04 20:47 | kgv | Summary | TDocStd_Application's Open() is blocked. => Application Framework - TDocStd_Application's Open() is blocked. |
| 2021-04-04 20:47 | kgv | Description Updated | |
| 2021-04-04 20:50 | kgv | Note Added: 0100094 | |
| 2021-04-05 17:27 | Kou Ouchi | Note Added: 0100108 | |
| 2021-04-09 16:44 |
|
Note Added: 0100208 | |
| 2021-04-09 16:44 |
|
Status | new => resolved |
| 2021-04-09 16:44 |
|
Steps to Reproduce Updated | |
| 2021-04-09 16:45 |
|
Assigned To | mpv => bugmaster |
| 2021-04-09 16:45 |
|
Note Added: 0100209 | |
| 2021-04-09 17:29 | Kou Ouchi | Note Added: 0100211 | |
| 2021-08-30 15:35 |
|
Note Added: 0103541 | |
| 2021-08-30 15:46 |
|
Status | resolved => feedback |
| 2021-09-03 14:10 | bugmaster | Status | feedback => closed |
| 2021-09-03 14:10 | bugmaster | Resolution | open => fixed |