Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
61d31c9
Add stream support to DESTL and DEVRML providers
dpasukhi Aug 5, 2025
d9ef5c4
Refactor Read and Write methods in DEIGES, DEOBJ, DEPLY, DESTL, DESTE…
dpasukhi Aug 5, 2025
bac9694
Refactor RWStl and StlAPI_Writer to use Standard_OStream for file ope…
dpasukhi Aug 6, 2025
006b26d
Add stream support for reading and writing STL data in DESTL and RWSt…
dpasukhi Aug 6, 2025
1275c7c
Add validation functions and improve error handling in DEVRML_Provider
dpasukhi Aug 6, 2025
ff29750
Remove stream support methods from DEGLTF, DEOBJ, and DEPLY providers…
dpasukhi Aug 6, 2025
c2d1056
Add validation and configuration helper functions in DEIGES_Provider
dpasukhi Aug 6, 2025
21c0a16
Add validation functions and improve error handling in DESTEP_Provider
dpasukhi Aug 6, 2025
f70420e
Refactor DEXCAF_Provider: Introduce validation and setup functions
dpasukhi Aug 6, 2025
6461952
Add DE_ValidationUtils: Implement validation utilities for configurat…
dpasukhi Aug 6, 2025
fe518fc
Refactor validation logic in data exchange providers
dpasukhi Aug 6, 2025
17b7e8b
Refactor Read method signatures in DE_Wrapper and update context vari…
dpasukhi Aug 6, 2025
bfc4afa
Refactor DESTEP_Provider: Remove unused setup functions and enhance s…
dpasukhi Aug 6, 2025
c672a46
Refactor DEBREP_Provider: Simplify Read and Write methods to delegate…
dpasukhi Aug 6, 2025
cfa7662
Refactor DE_Wrapper: Introduce FindReadProvider methods for file and …
dpasukhi Aug 6, 2025
450c442
Refactor configuration node headers: Update stream support comments f…
dpasukhi Aug 6, 2025
5c29b09
Refactor DE_ValidationUtils and DE_Wrapper: Introduce CreateContentBu…
dpasukhi Aug 6, 2025
0ded34e
Refactor DE_ValidationUtils: Improve CreateContentBuffer method to ha…
dpasukhi Aug 6, 2025
994ea3a
Refactor code formatting and improve readability across multiple files
dpasukhi Aug 6, 2025
0b19f98
Add unit tests for DEVRML_Provider: Validate stream-based read/write …
dpasukhi Aug 6, 2025
b581861
Add unit tests for DEVRML_Provider: Implement comprehensive tests for…
dpasukhi Aug 6, 2025
30e8305
Refactor stream handling in DEIGES, DESTEP, DESTL, and DEVRML providers
dpasukhi Aug 6, 2025
15972d8
Refactor stream handling: Change stream pointers to references in DE_…
dpasukhi Aug 6, 2025
9f3f319
Enhance DE_ValidationUtils and DEVRML_Provider: Clear stream error fl…
dpasukhi Aug 6, 2025
634dd91
Enhance DESTL_Provider: Add document and configuration validation dur…
dpasukhi Aug 6, 2025
25648b0
Add DESTEP_Provider_Test to CMake test files for improved coverage
dpasukhi Aug 6, 2025
6074f09
Enhance DESTEP_Provider: Refactor STEPCAF reader and writer configura…
dpasukhi Aug 6, 2025
42ac9c2
Enhance DEIGES_Provider: Refactor IGES reader and writer configuratio…
dpasukhi Aug 6, 2025
9b96f33
Add DEIGES_Provider_Test to CMake test files for improved coverage
dpasukhi Aug 6, 2025
5c526da
Refactor DEIGES_Provider: Move personizeWS call to ensure workspace p…
dpasukhi Aug 6, 2025
0e6f06e
Refactor DEIGES_Provider and DEIGES_ConfigurationNode: Remove unused …
dpasukhi Aug 6, 2025
ea18073
Remove DEIGES_Provider_Test from CMake test files as it has been deleted
dpasukhi Aug 6, 2025
00f6d46
Refactor DEXCAF and DEBREP Providers: Remove redundant stream read/wr…
dpasukhi Aug 6, 2025
846a3e4
Refactor DEVRML_Provider for code consistency and readability
dpasukhi Aug 6, 2025
a361d35
Add missing include for NCollection_List in DE_Provider header
dpasukhi Aug 6, 2025
424a2b4
Fix length unit setting in DESTEP_Provider Write methods for correct …
dpasukhi Aug 6, 2025
572d82a
Fix file size threshold in STL export test for accurate validation
dpasukhi Aug 6, 2025
3b457e4
Increase precision of facet normal output in RWStl and adjust file si…
dpasukhi Aug 7, 2025
1ac789a
Refactor validation utilities and improve buffer handling in DE_Valid…
dpasukhi Aug 8, 2025
732d79f
Improve code readability by reformatting buffer initialization and va…
dpasukhi Aug 8, 2025
d1b68fb
Simplify stream validation check in DE_ValidationUtils by removing re…
dpasukhi Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/DataExchange/TKDE/DE/DE_ConfigurationNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ bool DE_ConfigurationNode::IsExportSupported() const

//=================================================================================================

bool DE_ConfigurationNode::IsStreamSupported() const
{
return false;
}

//=================================================================================================

bool DE_ConfigurationNode::CheckExtension(const TCollection_AsciiString& theExtension) const
{
TCollection_AsciiString anExtension(theExtension);
Expand Down
12 changes: 8 additions & 4 deletions src/DataExchange/TKDE/DE/DE_ConfigurationNode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@ public:
const Standard_Boolean theToKeep);

public:
//! Checks the import supporting
//! @return Standard_True if import is support
//! Checks for import support.
//! @return Standard_True if import is supported
Standard_EXPORT virtual bool IsImportSupported() const;

//! Checks the export supporting
//! @return Standard_True if export is support
//! Checks for export support.
//! @return Standard_True if export is supported
Standard_EXPORT virtual bool IsExportSupported() const;

//! Checks for stream support.
//! @return Standard_True if streams are supported
Standard_EXPORT virtual bool IsStreamSupported() const;

//! Gets CAD format name of associated provider
//! @return provider CAD format
Standard_EXPORT virtual TCollection_AsciiString GetFormat() const = 0;
Expand Down
121 changes: 121 additions & 0 deletions src/DataExchange/TKDE/DE/DE_Provider.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <DE_ConfigurationNode.hxx>
#include <Message.hxx>
#include <NCollection_IndexedDataMap.hxx>

IMPLEMENT_STANDARD_RTTIEXT(DE_Provider, Standard_Transient)

Expand Down Expand Up @@ -148,3 +149,123 @@ Standard_Boolean DE_Provider::Write(const TCollection_AsciiString& thePath,
<< " doesn't support write operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Read(ReadStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theDocument;
(void)theWS;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream read operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Write(WriteStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theDocument;
(void)theWS;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream write operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Read(ReadStreamList& theStreams,
TopoDS_Shape& theShape,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theShape;
(void)theWS;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream read operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Write(WriteStreamList& theStreams,
const TopoDS_Shape& theShape,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theShape;
(void)theWS;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream write operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Read(ReadStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theDocument;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream read operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Write(WriteStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theDocument;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream write operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Read(ReadStreamList& theStreams,
TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theShape;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream read operation";
return Standard_False;
}

//=================================================================================================

Standard_Boolean DE_Provider::Write(WriteStreamList& theStreams,
const TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress)
{
(void)theStreams;
(void)theShape;
(void)theProgress;
Message::SendFail() << "Error: provider " << GetFormat() << " " << GetVendor()
<< " doesn't support stream write operation";
return Standard_False;
}
130 changes: 130 additions & 0 deletions src/DataExchange/TKDE/DE/DE_Provider.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#define _DE_Provider_HeaderFile

#include <Message_ProgressRange.hxx>
#include <NCollection_List.hxx>
#include <Standard_IStream.hxx>
#include <Standard_OStream.hxx>

class DE_ConfigurationNode;
class TopoDS_Shape;
Expand Down Expand Up @@ -43,6 +46,45 @@ class DE_Provider : public Standard_Transient
public:
DEFINE_STANDARD_RTTIEXT(DE_Provider, Standard_Transient)

//! Node to store write stream information
//! Contains relative path and reference to output stream
struct WriteStreamNode
{
TCollection_AsciiString Path; //!< Relative path to the output file
Standard_OStream& Stream; //!< Reference to output stream

//! Constructor
WriteStreamNode(const TCollection_AsciiString& thePath, Standard_OStream& theStream)
: Path(thePath),
Stream(theStream)
{
}
};

//! Node to store read stream information
//! Contains relative path and reference to input stream
struct ReadStreamNode
{
TCollection_AsciiString Path; //!< Relative path to the input file
Standard_IStream& Stream; //!< Reference to input stream

//! Constructor
ReadStreamNode(const TCollection_AsciiString& thePath, Standard_IStream& theStream)
: Path(thePath),
Stream(theStream)
{
}
};

public:
//! List to store write stream nodes
//! First element is the main stream, others are for internal referencing
using WriteStreamList = NCollection_List<WriteStreamNode>;

//! List to store read stream nodes
//! First element is the main stream, others are for internal referencing
using ReadStreamList = NCollection_List<ReadStreamNode>;

public:
//! Default constructor
//! Configure translation process with global configuration
Expand Down Expand Up @@ -77,6 +119,30 @@ public:
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads streams according to internal configuration
//! @param[in] theStreams streams to read from
//! @param[out] theDocument document to save result
//! @param[in] theWS current work session
//! @param[in] theProgress progress indicator
//! @return True if Read was successful
Standard_EXPORT virtual Standard_Boolean Read(
ReadStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Writes streams according to internal configuration
//! @param[in] theStreams streams to write to
//! @param[out] theDocument document to export
//! @param[in] theWS current work session
//! @param[in] theProgress progress indicator
//! @return True if Write was successful
Standard_EXPORT virtual Standard_Boolean Write(
WriteStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads a CAD file, according internal configuration
//! @param[in] thePath path to the import CAD file
//! @param[out] theDocument document to save result
Expand All @@ -97,6 +163,26 @@ public:
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads streams according to internal configuration
//! @param[in] theStreams streams to read from
//! @param[out] theDocument document to save result
//! @param[in] theProgress progress indicator
//! @return True if Read was successful
Standard_EXPORT virtual Standard_Boolean Read(
ReadStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Writes streams according to internal configuration
//! @param[in] theStreams streams to write to
//! @param[out] theDocument document to export
//! @param[in] theProgress progress indicator
//! @return True if Write was successful
Standard_EXPORT virtual Standard_Boolean Write(
WriteStreamList& theStreams,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads a CAD file, according internal configuration
//! @param[in] thePath path to the import CAD file
//! @param[out] theShape shape to save result
Expand All @@ -121,6 +207,30 @@ public:
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads streams according to internal configuration
//! @param[in] theStreams streams to read from
//! @param[out] theShape shape to save result
//! @param[in] theWS current work session
//! @param[in] theProgress progress indicator
//! @return True if Read was successful
Standard_EXPORT virtual Standard_Boolean Read(
ReadStreamList& theStreams,
TopoDS_Shape& theShape,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Writes streams according to internal configuration
//! @param[in] theStreams streams to write to
//! @param[out] theShape shape to export
//! @param[in] theWS current work session
//! @param[in] theProgress progress indicator
//! @return True if Write was successful
Standard_EXPORT virtual Standard_Boolean Write(
WriteStreamList& theStreams,
const TopoDS_Shape& theShape,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads a CAD file, according internal configuration
//! @param[in] thePath path to the import CAD file
//! @param[out] theShape shape to save result
Expand All @@ -141,6 +251,26 @@ public:
const TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Reads streams according to internal configuration
//! @param[in] theStreams streams to read from
//! @param[out] theShape shape to save result
//! @param[in] theProgress progress indicator
//! @return True if Read was successful
Standard_EXPORT virtual Standard_Boolean Read(
ReadStreamList& theStreams,
TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress = Message_ProgressRange());

//! Writes streams according to internal configuration
//! @param[in] theStreams streams to write to
//! @param[out] theShape shape to export
//! @param[in] theProgress progress indicator
//! @return True if Write was successful
Standard_EXPORT virtual Standard_Boolean Write(
WriteStreamList& theStreams,
const TopoDS_Shape& theShape,
const Message_ProgressRange& theProgress = Message_ProgressRange());

public:
//! Gets CAD format name of associated provider
//! @return provider CAD format
Expand Down
Loading
Loading