mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-22 03:16:39 +08:00
Coding - Global Refactoring OCCT as a part of 8.0.0 (#955)
- Added automated migration scripts for handle syntax, standard types, and macros - Deprecated legacy `Standard_*` types and macros in favor of native C++ equivalents - Introduced modern `occ` namespace with template-based type checking helpers - Enhanced NCollection macros to support variadic arguments for complex template types- Added automated migration scripts for handle syntax, standard types, and macros - Deprecated legacy `Standard_*` types and macros in favor of native C++ equivalents - Introduced modern `occ` namespace with template-based type checking helpers - Enhanced NCollection macros to support variadic arguments for complex template types
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
#include <GeomTools_SurfaceSet.hxx>
|
||||
#include <GeomTools_CurveSet.hxx>
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <NCollection_IndexedMap.hxx>
|
||||
#include <TopTools_ShapeSet.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
@@ -44,76 +45,72 @@ public:
|
||||
|
||||
//! Builds an empty ShapeSet.
|
||||
//! @param theWithTriangles flag to write triangulation data
|
||||
Standard_EXPORT BRepTools_ShapeSet(const Standard_Boolean theWithTriangles = Standard_True,
|
||||
const Standard_Boolean theWithNormals = Standard_False);
|
||||
Standard_EXPORT BRepTools_ShapeSet(const bool theWithTriangles = true,
|
||||
const bool theWithNormals = false);
|
||||
|
||||
//! Builds an empty ShapeSet.
|
||||
//! @param theWithTriangles flag to write triangulation data
|
||||
Standard_EXPORT BRepTools_ShapeSet(const BRep_Builder& theBuilder,
|
||||
const Standard_Boolean theWithTriangles = Standard_True,
|
||||
const Standard_Boolean theWithNormals = Standard_False);
|
||||
Standard_EXPORT BRepTools_ShapeSet(const BRep_Builder& theBuilder,
|
||||
const bool theWithTriangles = true,
|
||||
const bool theWithNormals = false);
|
||||
|
||||
Standard_EXPORT virtual ~BRepTools_ShapeSet();
|
||||
|
||||
//! Return true if shape should be stored with triangles.
|
||||
Standard_Boolean IsWithTriangles() const { return myWithTriangles; }
|
||||
bool IsWithTriangles() const { return myWithTriangles; }
|
||||
|
||||
//! Return true if shape should be stored triangulation with normals.
|
||||
Standard_Boolean IsWithNormals() const { return myWithNormals; }
|
||||
bool IsWithNormals() const { return myWithNormals; }
|
||||
|
||||
//! Define if shape will be stored with triangles.
|
||||
//! Ignored (always written) if face defines only triangulation (no surface).
|
||||
void SetWithTriangles(const Standard_Boolean theWithTriangles)
|
||||
{
|
||||
myWithTriangles = theWithTriangles;
|
||||
}
|
||||
void SetWithTriangles(const bool theWithTriangles) { myWithTriangles = theWithTriangles; }
|
||||
|
||||
//! Define if shape will be stored triangulation with normals.
|
||||
//! Ignored (always written) if face defines only triangulation (no surface).
|
||||
void SetWithNormals(const Standard_Boolean theWithNormals) { myWithNormals = theWithNormals; }
|
||||
void SetWithNormals(const bool theWithNormals) { myWithNormals = theWithNormals; }
|
||||
|
||||
//! Clears the content of the set.
|
||||
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void Clear() override;
|
||||
|
||||
//! Stores the geometry of <S>.
|
||||
Standard_EXPORT virtual void AddGeometry(const TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void AddGeometry(const TopoDS_Shape& S) override;
|
||||
|
||||
//! Dumps the geometry of me on the stream <OS>.
|
||||
Standard_EXPORT virtual void DumpGeometry(Standard_OStream& OS) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void DumpGeometry(Standard_OStream& OS) const override;
|
||||
|
||||
//! Writes the geometry of me on the stream <OS> in a
|
||||
//! format that can be read back by Read.
|
||||
Standard_EXPORT virtual void WriteGeometry(
|
||||
Standard_OStream& OS,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) override;
|
||||
|
||||
//! Reads the geometry of me from the stream <IS>.
|
||||
Standard_EXPORT virtual void ReadGeometry(
|
||||
Standard_IStream& IS,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) override;
|
||||
|
||||
//! Dumps the geometry of <S> on the stream <OS>.
|
||||
Standard_EXPORT virtual void DumpGeometry(const TopoDS_Shape& S,
|
||||
Standard_OStream& OS) const Standard_OVERRIDE;
|
||||
Standard_OStream& OS) const override;
|
||||
|
||||
//! Writes the geometry of <S> on the stream <OS> in a
|
||||
//! format that can be read back by Read.
|
||||
Standard_EXPORT virtual void WriteGeometry(const TopoDS_Shape& S,
|
||||
Standard_OStream& OS) const Standard_OVERRIDE;
|
||||
Standard_OStream& OS) const override;
|
||||
|
||||
//! Reads the geometry of a shape of type <T> from the
|
||||
//! stream <IS> and returns it in <S>.
|
||||
Standard_EXPORT virtual void ReadGeometry(const TopAbs_ShapeEnum T,
|
||||
Standard_IStream& IS,
|
||||
TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
TopoDS_Shape& S) override;
|
||||
|
||||
//! Inserts the shape <S2> in the shape <S1>. This
|
||||
//! method must be redefined to use the correct
|
||||
//! builder.
|
||||
Standard_EXPORT virtual void AddShapes(TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void AddShapes(TopoDS_Shape& S1, const TopoDS_Shape& S2) override;
|
||||
|
||||
Standard_EXPORT virtual void Check(const TopAbs_ShapeEnum T, TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void Check(const TopAbs_ShapeEnum T, TopoDS_Shape& S) override;
|
||||
|
||||
//! Reads the 3d polygons of me
|
||||
//! from the stream <IS>.
|
||||
@@ -126,7 +123,7 @@ public:
|
||||
//! be read back by Read.
|
||||
Standard_EXPORT void WritePolygon3D(
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean Compact = Standard_True,
|
||||
const bool Compact = true,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||
|
||||
//! Dumps the 3d polygons
|
||||
@@ -144,7 +141,7 @@ public:
|
||||
//! be read back by Read.
|
||||
Standard_EXPORT void WriteTriangulation(
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean Compact = Standard_True,
|
||||
const bool Compact = true,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||
|
||||
//! Dumps the triangulation
|
||||
@@ -162,29 +159,28 @@ public:
|
||||
//! be read back by Read.
|
||||
Standard_EXPORT void WritePolygonOnTriangulation(
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean Compact = Standard_True,
|
||||
const bool Compact = true,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||
|
||||
//! Dumps the polygons on triangulation
|
||||
//! on the stream <OS>.
|
||||
Standard_EXPORT void DumpPolygonOnTriangulation(Standard_OStream& OS) const;
|
||||
|
||||
protected:
|
||||
private:
|
||||
BRep_Builder myBuilder;
|
||||
GeomTools_SurfaceSet mySurfaces;
|
||||
GeomTools_CurveSet myCurves;
|
||||
GeomTools_Curve2dSet myCurves2d;
|
||||
TColStd_IndexedMapOfTransient myPolygons2D;
|
||||
TColStd_IndexedMapOfTransient myPolygons3D;
|
||||
NCollection_IndexedDataMap<Handle(Poly_Triangulation),
|
||||
BRep_Builder myBuilder;
|
||||
GeomTools_SurfaceSet mySurfaces;
|
||||
GeomTools_CurveSet myCurves;
|
||||
GeomTools_Curve2dSet myCurves2d;
|
||||
NCollection_IndexedMap<occ::handle<Standard_Transient>> myPolygons2D;
|
||||
NCollection_IndexedMap<occ::handle<Standard_Transient>> myPolygons3D;
|
||||
NCollection_IndexedDataMap<occ::handle<Poly_Triangulation>,
|
||||
// clang-format off
|
||||
Standard_Boolean> myTriangulations; //!< Contains a boolean flag with information
|
||||
bool> myTriangulations; //!< Contains a boolean flag with information
|
||||
//! to save normals for triangulation
|
||||
// clang-format on
|
||||
TColStd_IndexedMapOfTransient myNodes;
|
||||
Standard_Boolean myWithTriangles;
|
||||
Standard_Boolean myWithNormals;
|
||||
NCollection_IndexedMap<occ::handle<Standard_Transient>> myNodes;
|
||||
bool myWithTriangles;
|
||||
bool myWithNormals;
|
||||
};
|
||||
|
||||
#endif // _BRepTools_ShapeSet_HeaderFile
|
||||
|
||||
Reference in New Issue
Block a user