View Issue Details

IDProjectCategoryView StatusLast Update
0032280CommunityOCCT:Application Frameworkpublic2021-09-03 14:10
ReporterKou Ouchi Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version7.5.0 
Summary0032280: Application Framework - TDocStd_Application's Open() is blocked.
DescriptionTDocStd_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 ReproduceNot required
TagsNo tags attached.
Test case number

Attached Files

  • main.cxx (4,078 bytes)

Activities

Kou Ouchi

2021-04-04 18:16

reporter  

main.cxx (4,078 bytes)

kgv

2021-04-04 20:50

developer   ~0100094

  std::ifstream filestream("test.xbf", std::ifstream::in);

Are you sure you want to open a binary (XBF) file as a text stream?

Kou Ouchi

2021-04-05 17:27

reporter   ~0100108

Binary stream is returned normaly. I'm sure that my test code was bugged.
Thank you for reply.

mpv

2021-04-09 16:44

developer   ~0100208

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.

mpv

2021-04-09 16:45

developer   ~0100209

Dear bugmaster, please close this issue.

Kou Ouchi

2021-04-09 17:29

reporter   ~0100211

Hi, Thank you for your reply.

I understood your issues.

mpv

2021-08-30 15:35

developer   ~0103541

Dear bugmaster, could you close this issue.

Issue History

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 mpv Note Added: 0100208
2021-04-09 16:44 mpv Status new => resolved
2021-04-09 16:44 mpv Steps to Reproduce Updated
2021-04-09 16:45 mpv Assigned To mpv => bugmaster
2021-04-09 16:45 mpv Note Added: 0100209
2021-04-09 17:29 Kou Ouchi Note Added: 0100211
2021-08-30 15:35 mpv Note Added: 0103541
2021-08-30 15:46 mpv Status resolved => feedback
2021-09-03 14:10 bugmaster Status feedback => closed
2021-09-03 14:10 bugmaster Resolution open => fixed