Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mzernova committed Jan 15, 2025
1 parent e012fd9 commit 577ed06
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
49 changes: 28 additions & 21 deletions src/RWGltf/RWGltf_CafWriter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ protected:
//! Write mesh nodes into binary file.
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
//! @param[in] theShapeIter current shape to write
//! @param[in][out] theAccessorNb last accessor index
//! @param[in][out] theMesh mesh
Standard_EXPORT virtual void saveNodes (RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_ShapeIterator& theFaceIter,
const RWMesh_ShapeIterator& theShapeIter,
Standard_Integer& theAccessorNb,
const std::shared_ptr<RWGltf_CafWriter::Mesh>& theMesh) const;

Expand Down Expand Up @@ -251,16 +251,16 @@ protected:
//! Write mesh indexes into binary file.
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
//! @param[in] theShapeIter current shape to write
//! @param[in][out] theAccessorNb last accessor index
//! @param[in][out] theMesh mesh
Standard_EXPORT virtual void saveIndices (RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_ShapeIterator& theFaceIter,
const RWMesh_ShapeIterator& theShapeIter,
Standard_Integer& theAccessorNb,
const std::shared_ptr<RWGltf_CafWriter::Mesh>& theMesh);

//! Write mesh indexes into binary file.
//! Write triangle indexes into binary file.
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
Expand All @@ -270,18 +270,18 @@ protected:
const RWMesh_FaceIterator& theFaceIter,
const std::shared_ptr<RWGltf_CafWriter::Mesh>& theMesh);

//! Write mesh indexes into binary file.
//! Write edge indexes into binary file.
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
//! @param[in] theEdgeIter current edge to write
Standard_EXPORT virtual void saveEdgeIndices (RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_EdgeIterator& theEdgeIter);

//! Write mesh indexes into binary file.
//! Write vertex indexes into binary file.
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
//! @param[in] theVertexIter current vertex to write
Standard_EXPORT virtual void saveVertexIndices (RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_VertexIterator& theVertexIter);
Expand Down Expand Up @@ -388,22 +388,23 @@ protected:
Standard_EXPORT virtual void writeExtrasAttributes (const Handle(TDataStd_NamedData)& theNamedData);

//! Dispatch shapes
//! @param[in] theDocNode
//! @param[in] thePSentryBin
//! @param[in,out] theMergedFaces
//! @param[in,out] theShapeIter
//! @param[in] theDocNode Document node containing shape data
//! @param[in] thePSentryBin Progress scope for the operation
//! @param[in,out] theMergedFaces Data map to store merged faces
//! @param[in,out] theShapeIter Shape iterator to traverse shapes
Standard_EXPORT virtual void dispatchShapes (const XCAFPrs_DocumentNode& theDocNode,
const Message_ProgressScope& thePSentryBin,
NCollection_DataMap<XCAFPrs_Style, Handle(RWGltf_GltfFace)>& theMergedFaces,
RWMesh_ShapeIterator& theShapeIter);

//! Dispatch shapes
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile output file to write into
//! @param[in] theFaceIter current face to write
//! @param[in][out] theAccessorNb last accessor index
//! @param[in][out] theMesh mesh
//! @param[in] theArrType
//! Write shape into binary file
//! @param[out] theGltfFace glTF face definition
//! @param[out] theBinFile Output file to write into
//! @param[in] theShapeIter Current shape iterator
//! @param[in,out] theAccessorNb Last accessor index
//! @param[in,out] theMesh Mesh data
//! @param[in] theArrType Array type for glTF
//! @return True if shapes were successfully written to the binary file, false otherwise
Standard_EXPORT virtual bool writeShapesToBin (RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_ShapeIterator& theShapeIter,
Expand All @@ -412,7 +413,13 @@ protected:
const RWGltf_GltfArrayType theArrType);

//! Write shapes to RWGltf_GltfRootElement_Meshes section
//! @param[out] theGltfFace glTF face definition
//! @param[in] theShapeIter Shape iterator to traverse shapes
//! @param[in,out] theNbFacesInNode Number of faces in the current node
//! @param[in,out] theDracoBufInd Draco buffer index
//! @param[in,out] theToStartPrims Flag to indicate if primitives should be started
//! @param[in] theNodeName Name of the current node
//! @param[in,out] theWrittenShapes Map to store written shapes
//! @param[in,out] theDracoBufIndMap Map to store Draco buffer indices
Standard_EXPORT virtual void writeShapes (RWMesh_ShapeIterator& theShapeIter,
Standard_Integer& theNbFacesInNode,
Standard_Integer& theDracoBufInd,
Expand Down
18 changes: 18 additions & 0 deletions src/RWMesh/RWMesh_FaceIterator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,31 @@ public:
//! Return current face triangulation.
const Handle(Poly_Triangulation)& Triangulation() const { return myPolyTriang; }

//! Return true if mesh data is defined.
Standard_DEPRECATED("This method is deprecated - IsEmpty() should be called instead")
bool IsEmptyMesh() const { return IsEmpty(); }

//! Return true if mesh data is defined.
bool IsEmpty() const Standard_OVERRIDE
{
return myPolyTriang.IsNull()
|| (myPolyTriang->NbNodes() < 1 && myPolyTriang->NbTriangles() < 1);
}

public:

//! Return face material.
Standard_DEPRECATED("This method is deprecated - Style() should be called instead")
const XCAFPrs_Style& FaceStyle() const { return myStyle; }

//! Return TRUE if face color is set.
Standard_DEPRECATED("This method is deprecated - HasColor() should be called instead")
bool HasFaceColor() const { return myHasColor; }

//! Return face color.
Standard_DEPRECATED("This method is deprecated - Color() should be called instead")
const Quantity_ColorRGBA& FaceColor() const { return myColor; }

public:

//! Return number of elements of specific type for the current face.
Expand Down
2 changes: 1 addition & 1 deletion src/RWMesh/RWMesh_ShapeIterator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class TDF_Label;

//! Auxiliary class to iterate through shapes.
//! This is a virtual base class for other shape iterators.
class RWMesh_ShapeIterator
{
public:
Expand Down

0 comments on commit 577ed06

Please sign in to comment.