mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026106: BRepMesh - revision of data model
Removed tight connections between data structures, auxiliary tools and algorithms in order to create extensible solution, easy for maintenance and improvements; Code is separated on several functional units responsible for specific operation for the sake of simplification of debugging and readability; Introduced new data structures enabling possibility to manipulate discrete model of particular entity (edge, wire, face) in order to perform computations locally instead of processing an entire model. The workflow of updated component can be divided on six parts: * Creation of model data structure: source TopoDS_Shape passed to algorithm is analyzed and exploded on faces and edges. For each topological entity corresponding reflection is created in data model. Note that underlying algorithms use data model as input and access it via common interface which allows user to create custom data model with necessary dependencies between particular entities; * Discretize edges 3D & 2D curves: 3D curve as well as associated set of 2D curves of each model edge is discretized in order to create coherent skeleton used as a base in faces meshing process. In case if some edge of source shape already contains polygonal data which suites specified parameters, it is extracted from shape and stored to the model as is. Each edge is processed separately, adjacency is not taken into account; * Heal discrete model: source TopoDS_Shape can contain problems, such as open-wire or self-intersections, introduced during design, exchange or modification of model. In addition, some problems like self-intersections can be introduced by roughly discretized edges. This stage is responsible for analysis of discrete model in order to detect and repair faced problems or refuse model’s part for further processing in case if problem cannot be solved; * Preprocess discrete model: defines actions specific for implemented approach to be performed before meshing of faces. By default, iterates over model faces and checks consistency of existing triangulations. Cleans topological faces and its adjacent edges from polygonal data in case of inconsistency or marks face of discrete model as not required for computation; * Discretize faces: represents core part performing mesh generation for particular face based on 2D discrete data related to processing face. Caches polygonal data associated with face’s edges in data model for further processing and stores generated mesh to TopoDS_Face; * Postprocess discrete model: defines actions specific for implemented approach to be performed after meshing of faces. By default, stores polygonal data obtained on previous stage to TopoDS_Edge objects of source model. Component is now spread over IMeshData, IMeshTools, BRepMeshData and BRepMesh units. <!break> 1. Extend "tricheck" DRAW-command in order to find degenerated triangles. 2. Class BRepMesh_FastDiscret::Parameters has been declared as deprecated. 3. NURBS range splitter: do not split intervals without necessity. Intervals are split only in case if it is impossible to compute normals directly on intervals. 4. Default value of IMeshTools_Parameters::MinSize has been changed. New value is equal to 0.1*Deflection. 5. Correction of test scripts: 1) perf mesh bug27119: requested deflection is increased from 1e-6 to 1e-5 to keep reasonable performance (but still reproducing original issue) 2) bugs mesh bug26692_1, 2: make snapshot of triangulation instead of wireframe (irrelevant) Correction in upgrade guide.
This commit is contained in:
13
src/IMeshData/FILES
Normal file
13
src/IMeshData/FILES
Normal file
@@ -0,0 +1,13 @@
|
||||
IMeshData_Curve.hxx
|
||||
IMeshData_Edge.hxx
|
||||
IMeshData_Face.hxx
|
||||
IMeshData_Model.hxx
|
||||
IMeshData_ParametersList.hxx
|
||||
IMeshData_ParametersListArrayAdaptor.hxx
|
||||
IMeshData_PCurve.hxx
|
||||
IMeshData_Shape.hxx
|
||||
IMeshData_Status.hxx
|
||||
IMeshData_StatusOwner.hxx
|
||||
IMeshData_TessellatedShape.hxx
|
||||
IMeshData_Types.hxx
|
||||
IMeshData_Wire.hxx
|
62
src/IMeshData/IMeshData_Curve.hxx
Normal file
62
src/IMeshData/IMeshData_Curve.hxx
Normal file
@@ -0,0 +1,62 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Curve_HeaderFile
|
||||
#define _IMeshData_Curve_HeaderFile
|
||||
|
||||
#include <IMeshData_ParametersList.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
class gp_Pnt;
|
||||
|
||||
//! Interface class representing discrete 3d curve of edge.
|
||||
//! Indexation of points starts from zero.
|
||||
class IMeshData_Curve : public IMeshData_ParametersList
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Curve()
|
||||
{
|
||||
}
|
||||
|
||||
//! Inserts new discretization point at the given position.
|
||||
Standard_EXPORT virtual void InsertPoint(
|
||||
const Standard_Integer thePosition,
|
||||
const gp_Pnt& thePoint,
|
||||
const Standard_Real theParamOnPCurve) = 0;
|
||||
|
||||
//! Adds new discretization point to curve.
|
||||
Standard_EXPORT virtual void AddPoint (
|
||||
const gp_Pnt& thePoint,
|
||||
const Standard_Real theParamOnCurve) = 0;
|
||||
|
||||
//! Returns discretization point with the given index.
|
||||
Standard_EXPORT virtual gp_Pnt& GetPoint (const Standard_Integer theIndex) = 0;
|
||||
|
||||
//! Removes point with the given index.
|
||||
Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Curve, IMeshData_ParametersList)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_Curve()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
167
src/IMeshData/IMeshData_Edge.hxx
Normal file
167
src/IMeshData/IMeshData_Edge.hxx
Normal file
@@ -0,0 +1,167 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Edge_HeaderFile
|
||||
#define _IMeshData_Edge_HeaderFile
|
||||
|
||||
#include <IMeshData_TessellatedShape.hxx>
|
||||
#include <IMeshData_StatusOwner.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <IMeshData_Curve.hxx>
|
||||
#include <IMeshData_PCurve.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
class IMeshData_Face;
|
||||
|
||||
//! Interface class representing discrete model of an edge.
|
||||
class IMeshData_Edge : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Edge()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns TopoDS_Edge attached to model.
|
||||
inline const TopoDS_Edge& GetEdge () const
|
||||
{
|
||||
return TopoDS::Edge (GetShape ());
|
||||
}
|
||||
|
||||
//! Returns number of pcurves assigned to current edge.
|
||||
Standard_EXPORT virtual Standard_Integer PCurvesNb () const = 0;
|
||||
|
||||
//! Adds discrete pcurve for the specifed discrete face.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& AddPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation) = 0;
|
||||
|
||||
//! Returns pcurve for the specified discrete face.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation) const = 0;
|
||||
|
||||
//! Returns pcurve with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
|
||||
const Standard_Integer theIndex) const = 0;
|
||||
|
||||
//! Clears curve and all pcurves assigned to the edge from discretization.
|
||||
inline void Clear(const Standard_Boolean isKeepEndPoints)
|
||||
{
|
||||
myCurve->Clear(isKeepEndPoints);
|
||||
for (Standard_Integer aPCurveIt = 0; aPCurveIt < PCurvesNb(); ++aPCurveIt)
|
||||
{
|
||||
GetPCurve(aPCurveIt)->Clear(isKeepEndPoints);
|
||||
}
|
||||
}
|
||||
|
||||
//! Returns true in case if the edge is free one, i.e. it does not have pcurves.
|
||||
inline Standard_Boolean IsFree () const
|
||||
{
|
||||
return (PCurvesNb () == 0);
|
||||
}
|
||||
|
||||
//! Sets 3d curve associated with current edge.
|
||||
inline void SetCurve (const IMeshData::ICurveHandle& theCurve)
|
||||
{
|
||||
myCurve = theCurve;
|
||||
}
|
||||
|
||||
//! Returns 3d curve associated with current edge.
|
||||
inline const IMeshData::ICurveHandle& GetCurve () const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
||||
|
||||
//! Gets value of angular deflection for the discrete model.
|
||||
inline Standard_Real GetAngularDeflection () const
|
||||
{
|
||||
return myAngDeflection;
|
||||
}
|
||||
|
||||
//! Sets value of angular deflection for the discrete model.
|
||||
inline void SetAngularDeflection (const Standard_Real theValue)
|
||||
{
|
||||
myAngDeflection = theValue;
|
||||
}
|
||||
|
||||
//! Returns same param flag.
|
||||
//! By default equals to flag stored in topological shape.
|
||||
inline Standard_Boolean GetSameParam () const
|
||||
{
|
||||
return mySameParam;
|
||||
}
|
||||
|
||||
//! Updates same param flag.
|
||||
inline void SetSameParam (const Standard_Boolean theValue)
|
||||
{
|
||||
mySameParam = theValue;
|
||||
}
|
||||
|
||||
//! Returns same range flag.
|
||||
//! By default equals to flag stored in topological shape.
|
||||
inline Standard_Boolean GetSameRange () const
|
||||
{
|
||||
return mySameRange;
|
||||
}
|
||||
|
||||
//! Updates same range flag.
|
||||
inline void SetSameRange (const Standard_Boolean theValue)
|
||||
{
|
||||
mySameRange = theValue;
|
||||
}
|
||||
|
||||
//! Returns degenerative flag.
|
||||
//! By default equals to flag stored in topological shape.
|
||||
inline Standard_Boolean GetDegenerated () const
|
||||
{
|
||||
return myDegenerated;
|
||||
}
|
||||
|
||||
//! Updates degenerative flag.
|
||||
inline void SetDegenerated (const Standard_Boolean theValue)
|
||||
{
|
||||
myDegenerated = theValue;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Edge, IMeshData_TessellatedShape)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
//! Initializes empty model.
|
||||
Standard_EXPORT IMeshData_Edge (const TopoDS_Edge& theEdge)
|
||||
: IMeshData_TessellatedShape(theEdge),
|
||||
mySameParam (BRep_Tool::SameParameter(theEdge)),
|
||||
mySameRange (BRep_Tool::SameRange (theEdge)),
|
||||
myDegenerated(BRep_Tool::Degenerated (theEdge)),
|
||||
myAngDeflection(RealLast())
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Standard_Boolean mySameParam;
|
||||
Standard_Boolean mySameRange;
|
||||
Standard_Boolean myDegenerated;
|
||||
Standard_Real myAngDeflection;
|
||||
IMeshData::ICurveHandle myCurve;
|
||||
};
|
||||
|
||||
#endif
|
93
src/IMeshData/IMeshData_Face.hxx
Normal file
93
src/IMeshData/IMeshData_Face.hxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Face_HeaderFile
|
||||
#define _IMeshData_Face_HeaderFile
|
||||
|
||||
#include <IMeshData_TessellatedShape.hxx>
|
||||
#include <IMeshData_StatusOwner.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <IMeshData_Status.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
|
||||
class IMeshData_Wire;
|
||||
class TopoDS_Wire;
|
||||
|
||||
//! Interface class representing discrete model of a face.
|
||||
//! Face model contains one or several wires.
|
||||
//! First wire is always outer one.
|
||||
class IMeshData_Face : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Face()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns number of wires.
|
||||
Standard_EXPORT virtual Standard_Integer WiresNb () const = 0;
|
||||
|
||||
//! Adds wire to discrete model of face.
|
||||
Standard_EXPORT virtual const IMeshData::IWireHandle& AddWire (
|
||||
const TopoDS_Wire& theWire,
|
||||
const Standard_Integer theEdgeNb = 0) = 0;
|
||||
|
||||
//! Returns discrete edge with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IWireHandle& GetWire (
|
||||
const Standard_Integer theIndex) const = 0;
|
||||
|
||||
//! Returns face's surface.
|
||||
inline const Handle(BRepAdaptor_HSurface)& GetSurface() const
|
||||
{
|
||||
return mySurface;
|
||||
}
|
||||
|
||||
//! Returns TopoDS_Face attached to model.
|
||||
inline const TopoDS_Face& GetFace () const
|
||||
{
|
||||
return TopoDS::Face (GetShape ());
|
||||
}
|
||||
|
||||
//! Returns whether the face discrete model is valid.
|
||||
inline Standard_Boolean IsValid () const
|
||||
{
|
||||
return (IsEqual(IMeshData_NoError) ||
|
||||
IsEqual(IMeshData_ReMesh) ||
|
||||
IsEqual(IMeshData_UnorientedWire));
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Face, IMeshData_TessellatedShape)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
//! Initializes empty model.
|
||||
Standard_EXPORT IMeshData_Face (const TopoDS_Face& theFace)
|
||||
: IMeshData_TessellatedShape(theFace)
|
||||
{
|
||||
BRepAdaptor_Surface aSurfAdaptor(GetFace(), Standard_False);
|
||||
mySurface = new BRepAdaptor_HSurface(aSurfAdaptor);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
mutable Handle(BRepAdaptor_HSurface) mySurface;
|
||||
};
|
||||
|
||||
#endif
|
76
src/IMeshData/IMeshData_Model.hxx
Normal file
76
src/IMeshData/IMeshData_Model.hxx
Normal file
@@ -0,0 +1,76 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Model_HeaderFile
|
||||
#define _IMeshData_Model_HeaderFile
|
||||
|
||||
#include <IMeshData_Shape.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Edge;
|
||||
class IMeshData_Face;
|
||||
class IMeshData_Edge;
|
||||
|
||||
//! Interface class representing discrete model of a shape.
|
||||
class IMeshData_Model : public IMeshData_Shape
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Model()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns maximum size of shape model.
|
||||
Standard_EXPORT virtual Standard_Real GetMaxSize () const = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Model, IMeshData_Shape)
|
||||
|
||||
public: //! @name discrete faces
|
||||
|
||||
//! Returns number of faces in discrete model.
|
||||
Standard_EXPORT virtual Standard_Integer FacesNb () const = 0;
|
||||
|
||||
//! Adds new face to shape model.
|
||||
Standard_EXPORT virtual const IMeshData::IFaceHandle& AddFace (const TopoDS_Face& theFace) = 0;
|
||||
|
||||
//! Gets model's face with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IFaceHandle& GetFace (const Standard_Integer theIndex) const = 0;
|
||||
|
||||
public: //! @name discrete edges
|
||||
|
||||
//! Returns number of edges in discrete model.
|
||||
Standard_EXPORT virtual Standard_Integer EdgesNb () const = 0;
|
||||
|
||||
//! Adds new edge to shape model.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgeHandle& AddEdge (const TopoDS_Edge& theEdge) = 0;
|
||||
|
||||
//! Gets model's edge with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgeHandle& GetEdge (const Standard_Integer theIndex) const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
//! Initializes empty model.
|
||||
Standard_EXPORT IMeshData_Model (const TopoDS_Shape& theShape)
|
||||
: IMeshData_Shape(theShape)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
99
src/IMeshData/IMeshData_PCurve.hxx
Normal file
99
src/IMeshData/IMeshData_PCurve.hxx
Normal file
@@ -0,0 +1,99 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_PCurve_HeaderFile
|
||||
#define _IMeshData_PCurve_HeaderFile
|
||||
|
||||
#include <IMeshData_ParametersList.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <IMeshData_Face.hxx>
|
||||
|
||||
class gp_Pnt2d;
|
||||
|
||||
//! Interface class representing pcurve of edge associated with discrete face.
|
||||
//! Indexation of points starts from zero.
|
||||
class IMeshData_PCurve : public IMeshData_ParametersList
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_PCurve()
|
||||
{
|
||||
}
|
||||
|
||||
//! Inserts new discretization point at the given position.
|
||||
Standard_EXPORT virtual void InsertPoint(
|
||||
const Standard_Integer thePosition,
|
||||
const gp_Pnt2d& thePoint,
|
||||
const Standard_Real theParamOnPCurve) = 0;
|
||||
|
||||
//! Adds new discretization point to pcurve.
|
||||
Standard_EXPORT virtual void AddPoint (
|
||||
const gp_Pnt2d& thePoint,
|
||||
const Standard_Real theParamOnPCurve) = 0;
|
||||
|
||||
//! Returns discretization point with the given index.
|
||||
Standard_EXPORT virtual gp_Pnt2d& GetPoint (const Standard_Integer theIndex) = 0;
|
||||
|
||||
//! Returns index in mesh corresponded to discretization point with the given index.
|
||||
Standard_EXPORT virtual Standard_Integer& GetIndex(const Standard_Integer theIndex) = 0;
|
||||
|
||||
//! Removes point with the given index.
|
||||
Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) = 0;
|
||||
|
||||
//! Returns forward flag of this pcurve.
|
||||
inline Standard_Boolean IsForward () const
|
||||
{
|
||||
return (myOrientation != TopAbs_REVERSED);
|
||||
}
|
||||
|
||||
//! Returns internal flag of this pcurve.
|
||||
inline Standard_Boolean IsInternal() const
|
||||
{
|
||||
return (myOrientation == TopAbs_INTERNAL);
|
||||
}
|
||||
|
||||
//! Returns orientation of the edge associated with current pcurve.
|
||||
inline TopAbs_Orientation GetOrientation() const
|
||||
{
|
||||
return myOrientation;
|
||||
}
|
||||
|
||||
//! Returns discrete face pcurve is associated to.
|
||||
inline const IMeshData::IFacePtr& GetFace () const
|
||||
{
|
||||
return myDFace;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_PCurve, IMeshData_ParametersList)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_PCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation)
|
||||
: myDFace(theDFace),
|
||||
myOrientation(theOrientation)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
IMeshData::IFacePtr myDFace;
|
||||
TopAbs_Orientation myOrientation;
|
||||
};
|
||||
|
||||
#endif
|
54
src/IMeshData/IMeshData_ParametersList.hxx
Normal file
54
src/IMeshData/IMeshData_ParametersList.hxx
Normal file
@@ -0,0 +1,54 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_ParametersList_HeaderFile
|
||||
#define _IMeshData_ParametersList_HeaderFile
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//! Interface class representing list of parameters on curve.
|
||||
class IMeshData_ParametersList : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_ParametersList()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns parameter with the given index.
|
||||
Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) = 0;
|
||||
|
||||
//! Returns number of parameters.
|
||||
Standard_EXPORT virtual Standard_Integer ParametersNb() const = 0;
|
||||
|
||||
//! Clears parameters list.
|
||||
Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_ParametersList, Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_ParametersList()
|
||||
{
|
||||
}
|
||||
|
||||
//! Removes parameter with the given index.
|
||||
Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) = 0;
|
||||
};
|
||||
|
||||
#endif
|
70
src/IMeshData/IMeshData_ParametersListArrayAdaptor.hxx
Normal file
70
src/IMeshData/IMeshData_ParametersListArrayAdaptor.hxx
Normal file
@@ -0,0 +1,70 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_ParametersListArrayAdaptor_HeaderFile
|
||||
#define _IMeshData_ParametersListArrayAdaptor_HeaderFile
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <IMeshData_ParametersList.hxx>
|
||||
|
||||
//! Auxiliary tool representing adaptor interface for child classes of
|
||||
//! IMeshData_ParametersList to be used in tools working on NCollection_Array structure.
|
||||
template<class ParametersListPtrType>
|
||||
class IMeshData_ParametersListArrayAdaptor : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor. Initializes tool by the given parameters.
|
||||
Standard_EXPORT IMeshData_ParametersListArrayAdaptor(
|
||||
const ParametersListPtrType& theParameters)
|
||||
: myParameters (theParameters)
|
||||
{
|
||||
}
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_ParametersListArrayAdaptor()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns lower index in parameters array.
|
||||
Standard_EXPORT Standard_Integer Lower() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! Returns upper index in parameters array.
|
||||
Standard_EXPORT Standard_Integer Upper() const
|
||||
{
|
||||
return myParameters->ParametersNb() - 1;
|
||||
}
|
||||
|
||||
//! Returns value of the given index.
|
||||
Standard_EXPORT Standard_Real Value(const Standard_Integer theIndex) const
|
||||
{
|
||||
return myParameters->GetParameter(theIndex);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
IMeshData_ParametersListArrayAdaptor (
|
||||
const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther);
|
||||
|
||||
void operator=(const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther);
|
||||
|
||||
const ParametersListPtrType myParameters;
|
||||
};
|
||||
|
||||
#endif
|
66
src/IMeshData/IMeshData_Shape.hxx
Normal file
66
src/IMeshData/IMeshData_Shape.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Shape_HeaderFile
|
||||
#define _IMeshData_Shape_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//! Interface class representing model with associated TopoDS_Shape.
|
||||
//! Intended for inheritance by structures and algorithms keeping
|
||||
//! reference TopoDS_Shape.
|
||||
class IMeshData_Shape : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Shape()
|
||||
{
|
||||
}
|
||||
|
||||
//! Assigns shape to discrete shape.
|
||||
inline void SetShape (const TopoDS_Shape& theShape)
|
||||
{
|
||||
myShape = theShape;
|
||||
}
|
||||
|
||||
//! Returns shape assigned to discrete shape.
|
||||
const TopoDS_Shape& GetShape () const
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Shape, Standard_Transient)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_Shape()
|
||||
{
|
||||
}
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_Shape (const TopoDS_Shape& theShape)
|
||||
: myShape(theShape)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
};
|
||||
|
||||
#endif
|
33
src/IMeshData/IMeshData_Status.hxx
Normal file
33
src/IMeshData/IMeshData_Status.hxx
Normal file
@@ -0,0 +1,33 @@
|
||||
// Created on: 2011-05-17
|
||||
// Created by: Oleg AGASHIN
|
||||
// Copyright (c) 2011-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Status_HeaderFile
|
||||
#define _IMeshData_Status_HeaderFile
|
||||
|
||||
//! Enumerates statuses used to notify state of discrete model.
|
||||
enum IMeshData_Status
|
||||
{
|
||||
IMeshData_NoError = 0x0, //!< Mesh generation is successful.
|
||||
IMeshData_OpenWire = 0x1, //!< Notifies open wire problem, which can potentially lead to incorrect results.
|
||||
IMeshData_SelfIntersectingWire = 0x2, //!< Notifies self-intersections on discretized wire, which can potentially lead to incorrect results.
|
||||
IMeshData_Failure = 0x4, //!< Failed to generate mesh for some faces.
|
||||
IMeshData_ReMesh = 0x8, //!< Deflection of some edges has been decreased due to interference of discrete model.
|
||||
IMeshData_UnorientedWire = 0x10, //!< Notifies bad orientation of a wire, which can potentially lead to incorrect results.
|
||||
IMeshData_TooFewPoints = 0x20, //!< Discrete model contains too few boundary points to generate mesh.
|
||||
IMeshData_Outdated = 0x40, //!< Existing triangulation of some faces corresponds to greater deflection than specified by parameter.
|
||||
IMeshData_Reused = 0x80 //!< Existing triangulation of some faces is reused as far as it fits specified deflection.
|
||||
};
|
||||
|
||||
#endif
|
76
src/IMeshData/IMeshData_StatusOwner.hxx
Normal file
76
src/IMeshData/IMeshData_StatusOwner.hxx
Normal file
@@ -0,0 +1,76 @@
|
||||
// Created on: 2016-06-23
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_StatusOwner_HeaderFile
|
||||
#define _IMeshData_StatusOwner_HeaderFile
|
||||
|
||||
#include <IMeshData_Status.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//! Extension interface class providing status functionality.
|
||||
class IMeshData_StatusOwner
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_StatusOwner()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns true in case if status is strictly equal to the given value.
|
||||
inline Standard_Boolean IsEqual(const IMeshData_Status theValue) const
|
||||
{
|
||||
return (myStatus == theValue);
|
||||
}
|
||||
|
||||
//! Returns true in case if status is set.
|
||||
inline Standard_Boolean IsSet(const IMeshData_Status theValue) const
|
||||
{
|
||||
return (myStatus & theValue) != 0;
|
||||
}
|
||||
|
||||
//! Adds status to status flags of a face.
|
||||
inline void SetStatus(const IMeshData_Status theValue)
|
||||
{
|
||||
myStatus |= theValue;
|
||||
}
|
||||
|
||||
//! Adds status to status flags of a face.
|
||||
inline void UnsetStatus(const IMeshData_Status theValue)
|
||||
{
|
||||
myStatus &= ~theValue;
|
||||
}
|
||||
|
||||
//! Returns complete status mask.
|
||||
inline Standard_Integer GetStatusMask() const
|
||||
{
|
||||
return myStatus;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor. Initializes default status.
|
||||
Standard_EXPORT IMeshData_StatusOwner()
|
||||
: myStatus(IMeshData_NoError)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Standard_Integer myStatus;
|
||||
};
|
||||
|
||||
#endif
|
67
src/IMeshData/IMeshData_TessellatedShape.hxx
Normal file
67
src/IMeshData/IMeshData_TessellatedShape.hxx
Normal file
@@ -0,0 +1,67 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_TessellatedShape_HeaderFile
|
||||
#define _IMeshData_TessellatedShape_HeaderFile
|
||||
|
||||
#include <IMeshData_Shape.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//! Interface class representing shaped model with deflection.
|
||||
class IMeshData_TessellatedShape : public IMeshData_Shape
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_TessellatedShape()
|
||||
{
|
||||
}
|
||||
|
||||
//! Gets deflection value for the discrete model.
|
||||
inline Standard_Real GetDeflection () const
|
||||
{
|
||||
return myDeflection;
|
||||
}
|
||||
|
||||
//! Sets deflection value for the discrete model.
|
||||
inline void SetDeflection (const Standard_Real theValue)
|
||||
{
|
||||
myDeflection = theValue;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_TessellatedShape, IMeshData_Shape)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_TessellatedShape ()
|
||||
: myDeflection(RealLast())
|
||||
{
|
||||
}
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT IMeshData_TessellatedShape (const TopoDS_Shape& theShape)
|
||||
: IMeshData_Shape(theShape),
|
||||
myDeflection(RealLast())
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myDeflection;
|
||||
};
|
||||
|
||||
#endif
|
166
src/IMeshData/IMeshData_Types.hxx
Normal file
166
src/IMeshData/IMeshData_Types.hxx
Normal file
@@ -0,0 +1,166 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Types_HeaderFile
|
||||
#define _IMeshData_Types_HeaderFile
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <NCollection_Shared.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <NCollection_DefineAlloc.hxx>
|
||||
#include <NCollection_StdAllocator.hxx>
|
||||
#include <IMeshData_ParametersListArrayAdaptor.hxx>
|
||||
#include <TColStd_PackedMapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <NCollection_EBTree.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
#include <NCollection_CellFilter.hxx>
|
||||
#include <NCollection_IndexedDataMap.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <NCollection_IndexedMap.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
#include <Bnd_B2d.hxx>
|
||||
#include <BRepMesh_Circle.hxx>
|
||||
#include <BRepMesh_Triangle.hxx>
|
||||
#include <BRepMesh_PairOfIndex.hxx>
|
||||
#include <BRepMesh_Edge.hxx>
|
||||
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <list>
|
||||
|
||||
class IMeshData_Shape;
|
||||
class IMeshData_Face;
|
||||
class IMeshData_Wire;
|
||||
class IMeshData_Edge;
|
||||
class IMeshData_Curve;
|
||||
class IMeshData_PCurve;
|
||||
class IMeshData_Model;
|
||||
class BRepMesh_VertexInspector;
|
||||
class BRepMesh_CircleInspector;
|
||||
|
||||
#define DEFINE_INC_ALLOC \
|
||||
DEFINE_NCOLLECTION_ALLOC \
|
||||
void operator delete (void* /*theAddress*/) \
|
||||
{ \
|
||||
/*it's inc allocator, nothing to do*/ \
|
||||
}
|
||||
|
||||
namespace IMeshData
|
||||
{
|
||||
//! Default size for memory block allocated by IncAllocator.
|
||||
/**
|
||||
* The idea here is that blocks of the given size are returned to the system
|
||||
* rather than retained in the malloc heap, at least on WIN32 and WIN64 platforms.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
const size_t MEMORY_BLOCK_SIZE_HUGE = 1024 * 1024;
|
||||
#else
|
||||
const size_t MEMORY_BLOCK_SIZE_HUGE = 512 * 1024;
|
||||
#endif
|
||||
|
||||
typedef IMeshData_Edge* IEdgePtr;
|
||||
typedef IMeshData_Face* IFacePtr;
|
||||
|
||||
typedef Handle(IMeshData_Edge) IEdgeHandle;
|
||||
typedef Handle(IMeshData_Wire) IWireHandle;
|
||||
typedef Handle(IMeshData_Face) IFaceHandle;
|
||||
typedef Handle(IMeshData_Curve) ICurveHandle;
|
||||
typedef Handle(IMeshData_PCurve) IPCurveHandle;
|
||||
|
||||
typedef IMeshData_ParametersListArrayAdaptor<ICurveHandle> ICurveArrayAdaptor;
|
||||
typedef Handle(ICurveArrayAdaptor) ICurveArrayAdaptorHandle;
|
||||
|
||||
typedef NCollection_Shared<NCollection_EBTree<Standard_Integer, Bnd_Box2d> > BndBox2dTree;
|
||||
typedef NCollection_UBTreeFiller<Standard_Integer, Bnd_Box2d> BndBox2dTreeFiller;
|
||||
|
||||
// Vectors
|
||||
typedef NCollection_Shared<NCollection_Vector<IFaceHandle> > VectorOfIFaceHandles;
|
||||
typedef NCollection_Shared<NCollection_Vector<IWireHandle> > VectorOfIWireHandles;
|
||||
typedef NCollection_Shared<NCollection_Vector<IEdgeHandle> > VectorOfIEdgeHandles;
|
||||
typedef NCollection_Shared<NCollection_Vector<IPCurveHandle> > VectorOfIPCurveHandles;
|
||||
typedef NCollection_Shared<NCollection_Vector<IEdgePtr> > VectorOfIEdgePtrs;
|
||||
typedef NCollection_Shared<NCollection_Vector<Standard_Boolean> > VectorOfBoolean;
|
||||
typedef NCollection_Shared<NCollection_Vector<Standard_Integer> > VectorOfInteger;
|
||||
typedef NCollection_Shared<NCollection_Vector<TopAbs_Orientation> > VectorOfOrientation;
|
||||
typedef NCollection_Shared<NCollection_Vector<BRepMesh_Triangle> > VectorOfElements;
|
||||
typedef NCollection_Shared<NCollection_Vector<BRepMesh_Circle> > VectorOfCircle;
|
||||
|
||||
typedef NCollection_Shared<NCollection_Array1<BRepMesh_Vertex> > Array1OfVertexOfDelaun;
|
||||
typedef NCollection_Shared<NCollection_Vector<BRepMesh_Vertex> > VectorOfVertex;
|
||||
|
||||
// Sequences
|
||||
typedef NCollection_Shared<NCollection_Sequence<Bnd_B2d> > SequenceOfBndB2d;
|
||||
typedef NCollection_Shared<NCollection_Sequence<Standard_Integer> > SequenceOfInteger;
|
||||
typedef NCollection_Shared<NCollection_Sequence<Standard_Real> > SequenceOfReal;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
typedef std::deque<gp_Pnt, NCollection_StdAllocator<gp_Pnt> > SequenceOfPnt;
|
||||
typedef std::deque<gp_Pnt2d, NCollection_StdAllocator<gp_Pnt2d> > SequenceOfPnt2d;
|
||||
typedef std::deque<Standard_Real, NCollection_StdAllocator<Standard_Real> > SequenceOfReal;
|
||||
typedef std::deque<Standard_Integer, NCollection_StdAllocator<Standard_Integer> > SequenceOfInteger;
|
||||
}
|
||||
|
||||
// Lists
|
||||
typedef NCollection_Shared<NCollection_List<Standard_Integer> > ListOfInteger;
|
||||
typedef NCollection_Shared<NCollection_List<gp_Pnt2d> > ListOfPnt2d;
|
||||
typedef NCollection_Shared<NCollection_List<IPCurveHandle> > ListOfIPCurves;
|
||||
|
||||
typedef NCollection_Shared<TColStd_PackedMapOfInteger> MapOfInteger;
|
||||
typedef TColStd_MapIteratorOfPackedMapOfInteger IteratorOfMapOfInteger;
|
||||
|
||||
typedef NCollection_CellFilter<BRepMesh_CircleInspector> CircleCellFilter;
|
||||
typedef NCollection_CellFilter<BRepMesh_VertexInspector> VertexCellFilter;
|
||||
|
||||
// Data Maps
|
||||
template<typename Type>
|
||||
struct WeakEqual
|
||||
{
|
||||
static Standard_Boolean IsEqual(const Type* theFirst,
|
||||
const Type* theSecond)
|
||||
{
|
||||
return (theFirst == theSecond);
|
||||
}
|
||||
|
||||
static Standard_Integer HashCode(const Type* thePtr, Standard_Integer theUpper)
|
||||
{
|
||||
return ::HashCode(thePtr, theUpper);
|
||||
}
|
||||
};
|
||||
|
||||
typedef NCollection_Shared<NCollection_DataMap<TopoDS_Shape, Standard_Integer, TopTools_ShapeMapHasher> > DMapOfShapeInteger;
|
||||
typedef NCollection_Shared<NCollection_DataMap<IFacePtr, ListOfInteger, WeakEqual<IMeshData_Face> > > DMapOfIFacePtrsListOfInteger;
|
||||
typedef NCollection_Shared<NCollection_Map<IEdgePtr, WeakEqual<IMeshData_Edge> > > MapOfIEdgePtr;
|
||||
typedef NCollection_Shared<NCollection_Map<IFacePtr, WeakEqual<IMeshData_Face> > > MapOfIFacePtr;
|
||||
typedef NCollection_Shared<NCollection_Map<BRepMesh_OrientedEdge> > MapOfOrientedEdges;
|
||||
typedef NCollection_Shared<NCollection_Map<Standard_Real> > MapOfReal;
|
||||
typedef NCollection_Shared<NCollection_IndexedDataMap<IFacePtr, ListOfIPCurves, WeakEqual<IMeshData_Face> > > IDMapOfIFacePtrsListOfIPCurves;
|
||||
typedef NCollection_Shared<NCollection_DataMap<IFacePtr, Handle(MapOfIEdgePtr), WeakEqual<IMeshData_Face> > > DMapOfIFacePtrsMapOfIEdgePtrs;
|
||||
typedef NCollection_Shared<NCollection_IndexedDataMap<BRepMesh_Edge, BRepMesh_PairOfIndex> > IDMapOfLink;
|
||||
typedef NCollection_Shared<NCollection_DataMap<Standard_Integer, ListOfInteger> > DMapOfIntegerListOfInteger;
|
||||
typedef NCollection_Shared<NCollection_DataMap<Standard_Integer, Standard_Integer> > MapOfIntegerInteger;
|
||||
typedef NCollection_Shared<NCollection_IndexedMap<Standard_Real> > IMapOfReal;
|
||||
|
||||
typedef NCollection_Shared<NCollection_Array1<Standard_Integer> > Array1OfInteger;
|
||||
}
|
||||
|
||||
#endif
|
74
src/IMeshData/IMeshData_Wire.hxx
Normal file
74
src/IMeshData/IMeshData_Wire.hxx
Normal file
@@ -0,0 +1,74 @@
|
||||
// Created on: 2016-04-07
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Created by: Oleg AGASHIN
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IMeshData_Wire_HeaderFile
|
||||
#define _IMeshData_Wire_HeaderFile
|
||||
|
||||
#include <IMeshData_TessellatedShape.hxx>
|
||||
#include <IMeshData_StatusOwner.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
|
||||
class IMeshData_Edge;
|
||||
|
||||
//! Interface class representing discrete model of a wire.
|
||||
//! Wire should represent an ordered set of edges.
|
||||
class IMeshData_Wire : public IMeshData_TessellatedShape, public IMeshData_StatusOwner
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~IMeshData_Wire()
|
||||
{
|
||||
}
|
||||
|
||||
//! Returns TopoDS_Face attached to model.
|
||||
inline const TopoDS_Wire& GetWire () const
|
||||
{
|
||||
return TopoDS::Wire (GetShape ());
|
||||
}
|
||||
|
||||
//! Returns number of edges.
|
||||
Standard_EXPORT virtual Standard_Integer EdgesNb () const = 0;
|
||||
|
||||
//! Adds new discrete edge with specified orientation to wire chain.
|
||||
//! @return index of added edge in wire chain.
|
||||
Standard_EXPORT virtual Standard_Integer AddEdge (
|
||||
const IMeshData::IEdgePtr& theDEdge,
|
||||
const TopAbs_Orientation theOrientation) = 0;
|
||||
|
||||
//! Returns discrete edge with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgePtr& GetEdge (
|
||||
const Standard_Integer theIndex) const = 0;
|
||||
|
||||
//! Returns True if orientation of discrete edge with the given index is forward.
|
||||
Standard_EXPORT virtual TopAbs_Orientation GetEdgeOrientation (
|
||||
const Standard_Integer theIndex) const = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(IMeshData_Wire, IMeshData_TessellatedShape)
|
||||
|
||||
protected:
|
||||
|
||||
//! Constructor.
|
||||
//! Initializes empty model.
|
||||
Standard_EXPORT IMeshData_Wire(const TopoDS_Wire& theWire)
|
||||
: IMeshData_TessellatedShape(theWire)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user