View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032820 | Open CASCADE | OCCT:Data Exchange | public | 2022-02-07 14:29 | 2023-03-19 23:01 |
Reporter | kgv | Assigned To | dpasukhi | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.7.0 | Fixed in Version | 7.7.0 | ||
Summary | 0032820: Data Exchange - add VRML reader to XCAF document | ||||
Description | 0030115 introduced a tool for exporting XCAF document into VRML format, but there is still no symmetrical method for translation in opposite direction, which makes testing bugs like 0032819 difficult, although translation is relatively straightforward.namespace { //! Return string associated with VRML reader status. static const char* getVrmlErrorName (VrmlData_ErrorStatus theStatus) { switch (theStatus) { case VrmlData_StatusOK: return ""; case VrmlData_EmptyData: return "EmptyData"; case VrmlData_UnrecoverableError: return "UnrecoverableError"; case VrmlData_GeneralError: return "GeneralError"; case VrmlData_EndOfFile: return "EndOfFile"; case VrmlData_NotVrmlFile: return "NotVrmlFile"; case VrmlData_CannotOpenFile: return "CannotOpenFile"; case VrmlData_VrmlFormatError: return "VrmlFormatError"; case VrmlData_NumericInputError: return "NumericInputError"; case VrmlData_IrrelevantNumber: return "IrrelevantNumber"; case VrmlData_BooleanInputError: return "BooleanInputError"; case VrmlData_StringInputError: return "StringInputError"; case VrmlData_NodeNameUnknown: return "NodeNameUnknown"; case VrmlData_NonPositiveSize: return "NonPositiveSize"; case VrmlData_ReadUnknownNode: return "ReadUnknownNode"; case VrmlData_NonSupportedFeature: return "NonSupportedFeature"; case VrmlData_OutputStreamUndefined: return "OutputStreamUndefined"; case VrmlData_NotImplemented: return "NotImplemented"; } return "UNKNOWN"; } //! Process sub-shape. static void performMeshSubshape (RWMesh_NodeAttributeMap& theAttribMap, const VrmlData_DataMapOfShapeAppearance& theShapeAppMap, const TopoDS_Shape& theShape) { Handle(VrmlData_Appearance) anAppearance; if (theShapeAppMap.Find (theShape.TShape(), anAppearance)) { if (!anAppearance.IsNull() && !anAppearance->Material().IsNull()) { RWMesh_NodeAttributes aFaceAttribs; aFaceAttribs.Style.SetColorSurf (anAppearance->Material()->DiffuseColor()); theAttribMap.Bind (theShape, aFaceAttribs); } } for (TopoDS_Iterator aSubShapeIter (theShape, true, false); aSubShapeIter.More(); aSubShapeIter.Next()) { performMeshSubshape (theAttribMap, theShapeAppMap, aSubShapeIter.Value()); } } } //! The VRML mesh reader. class MyCafVrmlReader { //! Read the mesh from specified file. bool performMesh (const TCollection_AsciiString& theFile, const Standard_Boolean theToProbe) { Standard_CLocaleSentry aLocaleSentry; std::ifstream aFile; OSD_OpenStream (aFile, theFile.ToCString(), std::ios::in | std::ios::binary); if (!aFile.is_open() || !aFile.good()) { Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is not found"); return false; } if (theToProbe) { return false; // unsupported } // determine file location to load associated files TCollection_AsciiString aFolder; { OSD_Path aPath (theFile); aPath.SetName (""); aPath.SetExtension (""); aPath.SystemName (aFolder); } VrmlData_Scene aScene; aScene.SetLinearScale (myUnitFactor); aScene.SetVrmlDir (aFolder); aScene << aFile; VrmlData_DataMapOfShapeAppearance aShapeAppMap; TopoDS_Shape aShape = aScene.GetShape (aShapeAppMap); if (!aShape.IsNull()) { performMeshSubshape (myAttribMap, aShapeAppMap, aShape); myRootShapes.Append (aShape); } if (aScene.Status() != VrmlData_StatusOK || aShape.IsNull()) { Message::SendFail (TCollection_AsciiString ("Error ") + getVrmlErrorName (aScene.Status()) + " occurred at line " + aScene.GetLineError() + "\nwhile reading VRML file '" + theFile + "'"); return false; } return true; } protected: double myUnitFactor; //!< length unit scale factor }; | ||||
Steps To Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | de_mesh/vrml_read/A1, A2, A3, A4 | ||||
|
Branch CR32820 has been created by atychini. SHA-1: d9d3fbf511678eda6cf185955df811f6673d3917 Detailed log of new commits: Author: atychini Date: Tue Jul 12 23:48:02 2022 +0300 0032820: Data Exchange - add VRML reader to XCAF document Implementing VRML reader into XCAF document. |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 97d74810eeeb54cf8190564f52f46adf439395e2 |
|
Dear @dpasukhi, please review branch CR32820 All tests are ok, see http://jenkins-test-08.nnov.opencascade.com/view/CR32820-master-atychini/view/ALL/ |
|
+ std::ifstream aFile; + OSD_OpenStream(aFile, theFile.ToCString(), std::ios::in | std::ios::binary); Please use `OSD_FileSystem::DefaultFileSystem()`. + // determine file location to load associated files + TCollection_AsciiString aFolder; + { + OSD_Path aPath(theFile); + aPath.SetName(""); + aPath.SetExtension(""); + aPath.SystemName(aFolder); Consider using `OSD_Path::FolderAndFileFromPath()` instead. + +class VrmlAPI_CafReader : public RWMesh_CafReader Description is missing. + if (aFileUnitFactor <= 0.0) + { + Message::SendWarning() << "Warning: wrong length unit '" << aUnitStr << "'"; + } Invalid input should be a failure, not warning, I think. + if(aToUseExistingDoc) `toUseExistingDoc` following OCCT name conventions. + Message::SendFail() << "Error: file reading failed '" << aFilePath; Trailing open quote. + Handle(DDocStd_DrawDocument) aDrawDoc = new DDocStd_DrawDocument(aDoc); Unused variable. -nocreatedoc Looks like this option is mistreated. +ReadVrml D $aFile +XGetOneShape S_New D + +checktrinfo S_New -ref [trinfo S_Ref] + +Close D It is essential making also screenshots of a document in 3D viewer and check colors are presented as expected. + "\n\t\t: -memoryLimit memory usage limit (in MiB)" I don't see this option being implemented by new/old VRML reader logic, why it is exposed? + "\n\t\t: -fileUnit length unit of Vrml file content;" + "\n\t\t: -memoryLimit memory usage limit (in MiB)" + "\n\t\t: -fileCoordSys coordinate system defined by Vrml file; Yup when not specified." Inconsistent separators in listing (".", ";", ""). + //! Setting myUnitFactor to theUnitFactor + //! @param[in] theUnitFactor length unit scale factor + Standard_EXPORT void SetUnitFactor(const Standard_Real theUnitFactor); + + //! Get the length unit scale factor + //! @return the length unit scale factor + Standard_EXPORT Standard_Real UnitFactor() const; This property jeopardizes inheritance from RWMesh_CafReader and it's basic units conversion logic interface which is supposed to be used. |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: f7e9e2f5a4d2d07cb9624e5299e892aee2134c4e |
|
Dear dpasukhi, please review branch CR32820 Tests have completed successfully http://jenkins-test-08.nnov.opencascade.com/view/CR32820-master-atychini/view/ALL/ |
|
+ "(due to unexpected EOF, syntax error, memory limit)" << thePath; Space is missing. + Message::SendFail() << "Error in the Vrml_Provider during reading the file " << thePath; It is preferred to put file path into quotes. +bool VrmlAPI_CafReader::performMesh(const TCollection_AsciiString& theFile, + const Message_ProgressRange&, + const Standard_Boolean) Please don't ignore `theToProbe` parameter - return FALSE immediately if probing cannot be implemented. |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 715ed1bf5a17b1f2368d6de14c25c9dfe86d7de0 |
|
Remarks have been attached. Please fix it. remarks_08_09_22.txt (4,212 bytes) |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 07d0fafbbda351baf3fcb28cb0bce5d86d46a3aa |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 8522a1261912bd10f2d387bd4b48af5797950ee5 |
|
Dear dpasukhi, pleare review branch CR32820 There was one warning during MacOS compilation, I've rectified it. Remarks have been fixed, all tests are ok: http://jenkins-test-08.nnov.opencascade.com/view/CR32820-master-atychini/view/COMPARE/ |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 8f960eb826c0a726ac2607e48aa544c7a73df6a7 |
|
Branch CR32820 has been updated forcibly by atychini. SHA-1: 9826eb1a781adf1514023aa83d25a3aa5675d026 |
|
Branch CR32820 has been reviewed |
|
Combination - OCCT branch : IR-2022-09-23 master SHA - changes and them, and you can discard any commits you make in this b3284f3ba911e4d18477ff1788ace3d7201a8827 changes and them, and you can discard any commits you make in this e0ceb716c70188b98130b1550914140d0502a6f9 Products branch : IR-2022-09-23 SHA - f1708bcb12b969ae6e6578ab6d46bb65e135a733 was compiled on Linux, MacOS and Windows platforms and tested in optimize mode. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: Debian80-64: OCCT Total CPU difference: 18666.730000000585 / 18776.180000000597 [-0.58%] Products Total CPU difference: 11867.75000000012 / 11959.870000000119 [-0.77%] Windows-64-VC14: OCCT Total CPU difference: 20851.8125 / 20857.796875 [-0.03%] Products Total CPU difference: 14092.984375 / 14084.640625 [+0.06%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR32820 has been deleted by mnt. SHA-1: 9826eb1a781adf1514023aa83d25a3aa5675d026 |
occt: master 5bde4773 2022-07-12 23:48:02
Committer: |
0032820: Data Exchange - add VRML reader to XCAF document Implementing VRML reader into XCAF document. Updating DE_Wrapper according to VRML Reader. |
Affected Issues 0032820 |
|
mod - src/TKVRML/EXTERNLIB | Diff File | ||
mod - src/Vrml/Vrml_ConfigurationNode.cxx | Diff File | ||
mod - src/Vrml/Vrml_ConfigurationNode.hxx | Diff File | ||
mod - src/Vrml/Vrml_Provider.cxx | Diff File | ||
mod - src/VrmlAPI/FILES | Diff File | ||
add - src/VrmlAPI/VrmlAPI_CafReader.cxx | Diff File | ||
add - src/VrmlAPI/VrmlAPI_CafReader.hxx | Diff File | ||
mod - src/XDEDRAW/XDEDRAW_Common.cxx | Diff File | ||
mod - tests/de_mesh/grids.list | Diff File | ||
add - tests/de_mesh/vrml_read/A1 | Diff File | ||
add - tests/de_mesh/vrml_read/A2 | Diff File | ||
add - tests/de_mesh/vrml_read/A3 | Diff File | ||
add - tests/de_mesh/vrml_read/A4 | Diff File | ||
add - tests/de_mesh/vrml_read/begin | Diff File | ||
mod - tests/de_wrapper/configuration/A3 | Diff File | ||
mod - tests/de_wrapper/vrml/A5 | Diff File | ||
mod - tests/de_wrapper/vrml/A6 | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-02-07 14:29 | kgv | New Issue | |
2022-02-07 14:29 | kgv | Assigned To | => dpasukhi |
2022-02-07 14:29 | kgv | Relationship added | child of 0030115 |
2022-02-07 14:29 | kgv | Relationship added | related to 0032819 |
2022-07-11 16:16 | dpasukhi | Assigned To | dpasukhi => atychini |
2022-07-12 23:48 | git | Note Added: 0109785 | |
2022-07-13 13:12 | git | Note Added: 0109796 | |
2022-07-13 16:03 |
|
Assigned To | atychini => dpasukhi |
2022-07-13 16:03 |
|
Status | new => resolved |
2022-07-13 16:03 |
|
Steps to Reproduce Updated | |
2022-07-13 16:04 |
|
Steps to Reproduce Updated | |
2022-07-13 16:04 |
|
Note Added: 0109797 | |
2022-07-13 16:04 |
|
Note Edited: 0109797 | |
2022-07-13 16:27 | kgv | Note Added: 0109798 | |
2022-07-13 16:32 | dpasukhi | Assigned To | dpasukhi => atychini |
2022-07-13 16:32 | dpasukhi | Status | resolved => assigned |
2022-07-18 11:46 | git | Note Added: 0109851 | |
2022-07-20 09:43 |
|
Assigned To | atychini => dpasukhi |
2022-07-20 09:43 |
|
Status | assigned => resolved |
2022-07-20 09:43 |
|
Steps to Reproduce Updated | |
2022-07-20 09:43 |
|
Note Added: 0109883 | |
2022-07-20 17:55 | kgv | Note Added: 0109904 | |
2022-07-20 18:05 | git | Note Added: 0109905 | |
2022-08-09 16:42 | dpasukhi | Status | resolved => assigned |
2022-08-09 16:42 | dpasukhi | Note Added: 0110159 | |
2022-08-09 16:42 | dpasukhi | File Added: remarks_08_09_22.txt | |
2022-08-09 16:42 | dpasukhi | Note Edited: 0110159 | |
2022-08-09 16:43 | dpasukhi | Assigned To | dpasukhi => atychini |
2022-08-11 13:44 | git | Note Added: 0110188 | |
2022-08-12 14:01 | git | Note Added: 0110214 | |
2022-08-12 14:05 |
|
Assigned To | atychini => dpasukhi |
2022-08-12 14:05 |
|
Status | assigned => resolved |
2022-08-12 14:05 |
|
Note Added: 0110215 | |
2022-09-22 15:03 | git | Note Added: 0111185 | |
2022-09-22 15:04 | git | Note Added: 0111186 | |
2022-09-23 15:18 | dpasukhi | Assigned To | dpasukhi => bugmaster |
2022-09-23 15:18 | dpasukhi | Status | resolved => reviewed |
2022-09-23 15:18 | dpasukhi | Note Added: 0111212 | |
2022-09-25 13:31 |
|
Status | reviewed => tested |
2022-09-25 13:31 |
|
Note Added: 0111247 | |
2022-09-25 13:36 |
|
Test case number | => de_mesh/vrml_read/A1, A2, A3, A4 |
2022-09-25 13:38 |
|
Changeset attached | => occt master 5bde4773 |
2022-09-25 13:38 |
|
Assigned To | bugmaster => atychini |
2022-09-25 13:38 |
|
Status | tested => verified |
2022-09-25 13:38 |
|
Resolution | open => fixed |
2022-09-25 13:40 | git | Note Added: 0111252 | |
2022-11-03 13:14 | dpasukhi | Relationship added | parent of 0033190 |
2022-11-30 12:01 | dpasukhi | Assigned To | atychini => dpasukhi |
2023-03-19 23:01 | vglukhik | Status | verified => closed |
2023-03-19 23:01 | vglukhik | Fixed in Version | => 7.7.0 |