mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
126
src/BRepMeshData/BRepMeshData_Curve.cxx
Normal file
126
src/BRepMeshData/BRepMeshData_Curve.cxx
Normal file
@@ -0,0 +1,126 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_Curve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Curve::BRepMeshData_Curve (const Handle (NCollection_IncAllocator)& theAllocator)
|
||||
: myPoints (NCollection_StdAllocator<gp_Pnt>(theAllocator)),
|
||||
myParameters (NCollection_StdAllocator<Standard_Real>(theAllocator))
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Curve::~BRepMeshData_Curve ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: InsertPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_Curve::InsertPoint(
|
||||
const Standard_Integer thePosition,
|
||||
const gp_Pnt& thePoint,
|
||||
const Standard_Real theParamOnPCurve)
|
||||
{
|
||||
myPoints .insert(myPoints .begin() + thePosition, thePoint);
|
||||
myParameters.insert(myParameters.begin() + thePosition, theParamOnPCurve);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_Curve::AddPoint (
|
||||
const gp_Pnt& thePoint,
|
||||
const Standard_Real theParamOnPCurve)
|
||||
{
|
||||
myPoints .push_back(thePoint);
|
||||
myParameters.push_back(theParamOnPCurve);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
gp_Pnt& BRepMeshData_Curve::GetPoint (const Standard_Integer theIndex)
|
||||
{
|
||||
return myPoints[theIndex];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetParameter
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Real& BRepMeshData_Curve::GetParameter (const Standard_Integer theIndex)
|
||||
{
|
||||
return myParameters[theIndex];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: ParameterNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Curve::ParametersNb() const
|
||||
{
|
||||
return static_cast<Standard_Integer>(myParameters.size());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: RemovePoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_Curve::RemovePoint (const Standard_Integer theIndex)
|
||||
{
|
||||
myPoints.erase(myPoints.begin() + theIndex);
|
||||
removeParameter (theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: removeParameter
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_Curve::removeParameter (const Standard_Integer theIndex)
|
||||
{
|
||||
myParameters.erase(myParameters.begin() + theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Clear
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_Curve::Clear(const Standard_Boolean isKeepEndPoints)
|
||||
{
|
||||
if (!isKeepEndPoints)
|
||||
{
|
||||
myPoints .clear();
|
||||
myParameters.clear();
|
||||
}
|
||||
else if (ParametersNb() > 2)
|
||||
{
|
||||
myPoints .erase(myPoints .begin() + 1, myPoints .begin() + (myPoints .size() - 1));
|
||||
myParameters.erase(myParameters.begin() + 1, myParameters.begin() + (myParameters.size() - 1));
|
||||
}
|
||||
}
|
76
src/BRepMeshData/BRepMeshData_Curve.hxx
Normal file
76
src/BRepMeshData/BRepMeshData_Curve.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 _BRepMeshData_Curve_HeaderFile
|
||||
#define _BRepMeshData_Curve_HeaderFile
|
||||
|
||||
#include <IMeshData_Curve.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
|
||||
//! Default implementation of curve data model entity.
|
||||
class BRepMeshData_Curve : public IMeshData_Curve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_INC_ALLOC
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT BRepMeshData_Curve (const Handle (NCollection_IncAllocator)& theAllocator);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_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) Standard_OVERRIDE;
|
||||
|
||||
//! Adds new discretization point to pcurve.
|
||||
Standard_EXPORT virtual void AddPoint (
|
||||
const gp_Pnt& thePoint,
|
||||
const Standard_Real theParamOnCurve) Standard_OVERRIDE;
|
||||
|
||||
//! Returns discretization point with the given index.
|
||||
Standard_EXPORT virtual gp_Pnt& GetPoint (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Removes point with the given index.
|
||||
Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Returns parameter with the given index.
|
||||
Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Returns number of parameters stored in curve.
|
||||
Standard_EXPORT virtual Standard_Integer ParametersNb() const Standard_OVERRIDE;
|
||||
|
||||
//! Clears parameters list.
|
||||
Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Curve, IMeshData_Curve)
|
||||
|
||||
protected:
|
||||
|
||||
//! Removes parameter with the given index.
|
||||
Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
IMeshData::Model::SequenceOfPnt myPoints;
|
||||
IMeshData::Model::SequenceOfReal myParameters;
|
||||
};
|
||||
|
||||
#endif
|
102
src/BRepMeshData/BRepMeshData_Edge.cxx
Normal file
102
src/BRepMeshData/BRepMeshData_Edge.cxx
Normal file
@@ -0,0 +1,102 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_Edge.hxx>
|
||||
#include <BRepMeshData_PCurve.hxx>
|
||||
#include <BRepMeshData_Curve.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Edge::BRepMeshData_Edge (
|
||||
const TopoDS_Edge& theEdge,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator)
|
||||
: IMeshData_Edge (theEdge),
|
||||
myAllocator (theAllocator),
|
||||
myPCurves (256, myAllocator),
|
||||
myPCurvesMap(1, myAllocator)
|
||||
{
|
||||
SetCurve (IMeshData::ICurveHandle (new (myAllocator) BRepMeshData_Curve (myAllocator)));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Edge::~BRepMeshData_Edge ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddPCurve
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Edge::PCurvesNb () const
|
||||
{
|
||||
return myPCurves.Size ();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddPCurve
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IPCurveHandle& BRepMeshData_Edge::AddPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation)
|
||||
{
|
||||
const Standard_Integer aPCurveIndex = PCurvesNb ();
|
||||
// Add pcurve to list of pcurves
|
||||
IMeshData::IPCurveHandle aPCurve (new (myAllocator) BRepMeshData_PCurve (theDFace, theOrientation, myAllocator));
|
||||
myPCurves.Append (aPCurve);
|
||||
|
||||
// Map pcurve to faces.
|
||||
if (!myPCurvesMap.IsBound(theDFace))
|
||||
{
|
||||
myPCurvesMap.Bind(theDFace, IMeshData::ListOfInteger(myAllocator));
|
||||
}
|
||||
|
||||
IMeshData::ListOfInteger& aListOfPCurves = myPCurvesMap.ChangeFind(theDFace);
|
||||
aListOfPCurves.Append (aPCurveIndex);
|
||||
|
||||
return GetPCurve (aPCurveIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetPCurve
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IPCurveHandle& BRepMeshData_Edge::GetPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation) const
|
||||
{
|
||||
const IMeshData::ListOfInteger& aListOfPCurves = myPCurvesMap.Find (theDFace);
|
||||
const IMeshData::IPCurveHandle& aPCurve1 = myPCurves (aListOfPCurves.First ());
|
||||
return (aPCurve1->GetOrientation () == theOrientation) ?
|
||||
aPCurve1 :
|
||||
myPCurves (aListOfPCurves.Last ());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetPCurve
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IPCurveHandle& BRepMeshData_Edge::GetPCurve (
|
||||
const Standard_Integer theIndex) const
|
||||
{
|
||||
return myPCurves (theIndex);
|
||||
}
|
65
src/BRepMeshData/BRepMeshData_Edge.hxx
Normal file
65
src/BRepMeshData/BRepMeshData_Edge.hxx
Normal file
@@ -0,0 +1,65 @@
|
||||
// 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 _BRepMeshData_Edge_HeaderFile
|
||||
#define _BRepMeshData_Edge_HeaderFile
|
||||
|
||||
#include <IMeshData_Edge.hxx>
|
||||
#include <IMeshData_Curve.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
|
||||
//! Default implementation of edge data model entity.
|
||||
class BRepMeshData_Edge : public IMeshData_Edge
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_INC_ALLOC
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT BRepMeshData_Edge (
|
||||
const TopoDS_Edge& theEdge,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_Edge ();
|
||||
|
||||
//! Returns number of pcurves assigned to current edge.
|
||||
Standard_EXPORT virtual Standard_Integer PCurvesNb () const Standard_OVERRIDE;
|
||||
|
||||
//! Adds disrete pcurve for the specifed discrete face.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& AddPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation) Standard_OVERRIDE;
|
||||
|
||||
//! Returns pcurve for the specified discrete face.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns pcurve with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
|
||||
const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Edge, IMeshData_Edge)
|
||||
|
||||
private:
|
||||
|
||||
Handle (NCollection_IncAllocator) myAllocator;
|
||||
IMeshData::VectorOfIPCurveHandles myPCurves;
|
||||
IMeshData::DMapOfIFacePtrsListOfInteger myPCurvesMap;
|
||||
};
|
||||
|
||||
#endif
|
72
src/BRepMeshData/BRepMeshData_Face.cxx
Normal file
72
src/BRepMeshData/BRepMeshData_Face.cxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_Face.hxx>
|
||||
#include <BRepMeshData_Wire.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Face::BRepMeshData_Face (
|
||||
const TopoDS_Face& theFace,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator)
|
||||
: IMeshData_Face (theFace),
|
||||
myAllocator (theAllocator),
|
||||
myDWires (256, myAllocator)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Face::~BRepMeshData_Face ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: WiresNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Face::WiresNb () const
|
||||
{
|
||||
return myDWires.Size ();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddWire
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IWireHandle& BRepMeshData_Face::AddWire (
|
||||
const TopoDS_Wire& theWire,
|
||||
const Standard_Integer theEdgeNb)
|
||||
{
|
||||
IMeshData::IWireHandle aWire (new (myAllocator) BRepMeshData_Wire (theWire, theEdgeNb, myAllocator));
|
||||
myDWires.Append (aWire);
|
||||
return GetWire (WiresNb () - 1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetWire
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IWireHandle& BRepMeshData_Face::GetWire (
|
||||
const Standard_Integer theIndex) const
|
||||
{
|
||||
return myDWires (theIndex);
|
||||
}
|
58
src/BRepMeshData/BRepMeshData_Face.hxx
Normal file
58
src/BRepMeshData/BRepMeshData_Face.hxx
Normal file
@@ -0,0 +1,58 @@
|
||||
// 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 _BRepMeshData_Face_HeaderFile
|
||||
#define _BRepMeshData_Face_HeaderFile
|
||||
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <IMeshData_Face.hxx>
|
||||
#include <IMeshData_Wire.hxx>
|
||||
|
||||
//! Default implementation of face data model entity.
|
||||
class BRepMeshData_Face : public IMeshData_Face
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_INC_ALLOC
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT BRepMeshData_Face (
|
||||
const TopoDS_Face& theFace,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_Face ();
|
||||
|
||||
//! Gets number of children.
|
||||
Standard_EXPORT virtual Standard_Integer WiresNb () const Standard_OVERRIDE;
|
||||
|
||||
//! Gets wire with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IWireHandle& GetWire (
|
||||
const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
//! Adds wire to discrete model of face.
|
||||
Standard_EXPORT virtual const IMeshData::IWireHandle& AddWire (
|
||||
const TopoDS_Wire& theWire,
|
||||
const Standard_Integer theEdgeNb = 0) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Face, IMeshData_Face)
|
||||
|
||||
private:
|
||||
|
||||
Handle (NCollection_IncAllocator) myAllocator;
|
||||
IMeshData::VectorOfIWireHandles myDWires;
|
||||
};
|
||||
|
||||
#endif
|
100
src/BRepMeshData/BRepMeshData_Model.cxx
Normal file
100
src/BRepMeshData/BRepMeshData_Model.cxx
Normal file
@@ -0,0 +1,100 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_Model.hxx>
|
||||
#include <BRepMeshData_Face.hxx>
|
||||
#include <BRepMeshData_Edge.hxx>
|
||||
#include <BRepMesh_IncAllocator.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Model::BRepMeshData_Model (const TopoDS_Shape& theShape)
|
||||
: IMeshData_Model (theShape),
|
||||
myMaxSize (0.),
|
||||
myAllocator (new BRepMesh_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE)),
|
||||
myDFaces (256, myAllocator),
|
||||
myDEdges (256, myAllocator)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Model::~BRepMeshData_Model ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: FacesNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Model::FacesNb () const
|
||||
{
|
||||
return myDFaces.Size ();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddFace
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IFaceHandle& BRepMeshData_Model::AddFace (const TopoDS_Face& theFace)
|
||||
{
|
||||
IMeshData::IFaceHandle aFace (new (myAllocator) BRepMeshData_Face (theFace, myAllocator));
|
||||
myDFaces.Append (aFace);
|
||||
return myDFaces (FacesNb () - 1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetFace
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IFaceHandle& BRepMeshData_Model::GetFace (const Standard_Integer theIndex) const
|
||||
{
|
||||
return myDFaces (theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: EdgesNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Model::EdgesNb () const
|
||||
{
|
||||
return myDEdges.Size ();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddEdge
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IEdgeHandle& BRepMeshData_Model::AddEdge (const TopoDS_Edge& theEdge)
|
||||
{
|
||||
IMeshData::IEdgeHandle aEdge (new (myAllocator) BRepMeshData_Edge (theEdge, myAllocator));
|
||||
myDEdges.Append (aEdge);
|
||||
return myDEdges (EdgesNb () - 1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetEdge
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IEdgeHandle& BRepMeshData_Model::GetEdge (const Standard_Integer theIndex) const
|
||||
{
|
||||
return myDEdges (theIndex);
|
||||
}
|
81
src/BRepMeshData/BRepMeshData_Model.hxx
Normal file
81
src/BRepMeshData/BRepMeshData_Model.hxx
Normal file
@@ -0,0 +1,81 @@
|
||||
// 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 _BRepMeshData_Model_HeaderFile
|
||||
#define _BRepMeshData_Model_HeaderFile
|
||||
|
||||
#include <IMeshData_Model.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <IMeshData_Face.hxx>
|
||||
#include <IMeshData_Edge.hxx>
|
||||
|
||||
//! Default implementation of model entity.
|
||||
class BRepMeshData_Model : public IMeshData_Model
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor.
|
||||
//! Initializes empty model.
|
||||
Standard_EXPORT BRepMeshData_Model (const TopoDS_Shape& theShape);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_Model ();
|
||||
|
||||
//! Returns maximum size of shape's bounding box.
|
||||
Standard_EXPORT virtual Standard_Real GetMaxSize () const Standard_OVERRIDE
|
||||
{
|
||||
return myMaxSize;
|
||||
}
|
||||
|
||||
//! Sets maximum size of shape's bounding box.
|
||||
inline void SetMaxSize (const Standard_Real theValue)
|
||||
{
|
||||
myMaxSize = theValue;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Model, IMeshData_Model)
|
||||
|
||||
public: //! @name discrete faces
|
||||
|
||||
//! Returns number of faces in discrete model.
|
||||
Standard_EXPORT virtual Standard_Integer FacesNb () const Standard_OVERRIDE;
|
||||
|
||||
//! Adds new face to shape model.
|
||||
Standard_EXPORT virtual const IMeshData::IFaceHandle& AddFace (const TopoDS_Face& theFace) Standard_OVERRIDE;
|
||||
|
||||
//! Gets model's face with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IFaceHandle& GetFace (const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
public: //! @name discrete edges
|
||||
|
||||
//! Returns number of edges in discrete model.
|
||||
Standard_EXPORT virtual Standard_Integer EdgesNb () const Standard_OVERRIDE;
|
||||
|
||||
//! Adds new edge to shape model.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgeHandle& AddEdge (const TopoDS_Edge& theEdge) Standard_OVERRIDE;
|
||||
|
||||
//! Gets model's edge with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgeHandle& GetEdge (const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myMaxSize;
|
||||
Handle (NCollection_IncAllocator) myAllocator;
|
||||
IMeshData::VectorOfIFaceHandles myDFaces;
|
||||
IMeshData::VectorOfIEdgeHandles myDEdges;
|
||||
};
|
||||
|
||||
#endif
|
145
src/BRepMeshData/BRepMeshData_PCurve.cxx
Normal file
145
src/BRepMeshData/BRepMeshData_PCurve.cxx
Normal file
@@ -0,0 +1,145 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_PCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_PCurve::BRepMeshData_PCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator)
|
||||
: IMeshData_PCurve (theDFace, theOrientation),
|
||||
myPoints2d (NCollection_StdAllocator<gp_Pnt2d>(theAllocator)),
|
||||
myParameters (NCollection_StdAllocator<Standard_Real>(theAllocator)),
|
||||
myIndices (NCollection_StdAllocator<Standard_Integer>(theAllocator))
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_PCurve::~BRepMeshData_PCurve ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: InsertPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_PCurve::InsertPoint(
|
||||
const Standard_Integer thePosition,
|
||||
const gp_Pnt2d& thePoint,
|
||||
const Standard_Real theParamOnPCurve)
|
||||
{
|
||||
myPoints2d .insert(myPoints2d .begin() + thePosition, thePoint);
|
||||
myParameters.insert(myParameters.begin() + thePosition, theParamOnPCurve);
|
||||
myIndices .insert(myIndices .begin() + thePosition, 0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: AddPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_PCurve::AddPoint (
|
||||
const gp_Pnt2d& thePoint,
|
||||
const Standard_Real theParamOnPCurve)
|
||||
{
|
||||
myPoints2d .push_back(thePoint);
|
||||
myParameters.push_back(theParamOnPCurve);
|
||||
myIndices .push_back(0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetPoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
gp_Pnt2d& BRepMeshData_PCurve::GetPoint (const Standard_Integer theIndex)
|
||||
{
|
||||
return myPoints2d[theIndex];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetIndex
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer& BRepMeshData_PCurve::GetIndex(const Standard_Integer theIndex)
|
||||
{
|
||||
return myIndices[theIndex];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetParameter
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Real& BRepMeshData_PCurve::GetParameter (const Standard_Integer theIndex)
|
||||
{
|
||||
return myParameters[theIndex];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: ParameterNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_PCurve::ParametersNb() const
|
||||
{
|
||||
return static_cast<Standard_Integer>(myParameters.size());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: RemovePoint
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_PCurve::RemovePoint (const Standard_Integer theIndex)
|
||||
{
|
||||
myPoints2d.erase(myPoints2d.begin() + theIndex);
|
||||
myIndices .erase(myIndices .begin() + theIndex);
|
||||
removeParameter (theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: removeParameter
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_PCurve::removeParameter (const Standard_Integer theIndex)
|
||||
{
|
||||
myParameters.erase(myParameters.begin() + theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Clear
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
void BRepMeshData_PCurve::Clear(const Standard_Boolean isKeepEndPoints)
|
||||
{
|
||||
if (!isKeepEndPoints)
|
||||
{
|
||||
myPoints2d .clear();
|
||||
myParameters.clear();
|
||||
myIndices .clear();
|
||||
}
|
||||
else if (ParametersNb() > 2)
|
||||
{
|
||||
myPoints2d .erase(myPoints2d .begin() + 1, myPoints2d .begin() + (myPoints2d .size() - 1));
|
||||
myParameters.erase(myParameters.begin() + 1, myParameters.begin() + (myParameters.size() - 1));
|
||||
myIndices .erase(myIndices .begin() + 1, myIndices .begin() + (myIndices .size() - 1));
|
||||
}
|
||||
}
|
82
src/BRepMeshData/BRepMeshData_PCurve.hxx
Normal file
82
src/BRepMeshData/BRepMeshData_PCurve.hxx
Normal file
@@ -0,0 +1,82 @@
|
||||
// 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 _BRepMeshData_PCurve_HeaderFile
|
||||
#define _BRepMeshData_PCurve_HeaderFile
|
||||
|
||||
#include <IMeshData_PCurve.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
|
||||
//! Default implementation of pcurve data model entity.
|
||||
class BRepMeshData_PCurve : public IMeshData_PCurve
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_INC_ALLOC
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT BRepMeshData_PCurve (
|
||||
const IMeshData::IFacePtr& theDFace,
|
||||
const TopAbs_Orientation theOrientation,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_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) Standard_OVERRIDE;
|
||||
|
||||
//! Adds new discretization point to pcurve.
|
||||
Standard_EXPORT virtual void AddPoint (
|
||||
const gp_Pnt2d& thePoint,
|
||||
const Standard_Real theParamOnPCurve) Standard_OVERRIDE;
|
||||
|
||||
//! Returns discretization point with the given index.
|
||||
Standard_EXPORT virtual gp_Pnt2d& GetPoint (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Returns index in mesh corresponded to discretization point with the given index.
|
||||
Standard_EXPORT virtual Standard_Integer& GetIndex(const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Removes point with the given index.
|
||||
Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Returns parameter with the given index.
|
||||
Standard_EXPORT virtual Standard_Real& GetParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
//! Returns number of parameters stored in pcurve.
|
||||
Standard_EXPORT virtual Standard_Integer ParametersNb() const Standard_OVERRIDE;
|
||||
|
||||
//! Clears parameters list.
|
||||
Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_PCurve, IMeshData_PCurve)
|
||||
|
||||
protected:
|
||||
|
||||
//! Removes parameter with the given index.
|
||||
Standard_EXPORT virtual void removeParameter (const Standard_Integer theIndex) Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
IMeshData::Model::SequenceOfPnt2d myPoints2d;
|
||||
IMeshData::Model::SequenceOfReal myParameters;
|
||||
IMeshData::Model::SequenceOfInteger myIndices;
|
||||
};
|
||||
|
||||
#endif
|
86
src/BRepMeshData/BRepMeshData_Wire.cxx
Normal file
86
src/BRepMeshData/BRepMeshData_Wire.cxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// 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.
|
||||
|
||||
#include <BRepMeshData_Wire.hxx>
|
||||
#include <IMeshData_Edge.hxx>
|
||||
#include <BRepMesh_OrientedEdge.hxx>
|
||||
#include <BRepMesh_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// Function: Constructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Wire::BRepMeshData_Wire (
|
||||
const TopoDS_Wire& theWire,
|
||||
const Standard_Integer theEdgeNb,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator)
|
||||
: IMeshData_Wire (theWire),
|
||||
myDEdges (theEdgeNb > 0 ? theEdgeNb : 256, theAllocator),
|
||||
myDEdgesOri (theEdgeNb > 0 ? theEdgeNb : 256, theAllocator)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
BRepMeshData_Wire::~BRepMeshData_Wire ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: EdgesNb
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Wire::EdgesNb () const
|
||||
{
|
||||
return myDEdges.Size ();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: Destructor
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BRepMeshData_Wire::AddEdge (
|
||||
const IMeshData::IEdgePtr& theDEdge,
|
||||
const TopAbs_Orientation theOrientation)
|
||||
{
|
||||
const Standard_Integer aIndex = EdgesNb ();
|
||||
|
||||
myDEdges .Append (theDEdge);
|
||||
myDEdgesOri.Append (theOrientation);
|
||||
|
||||
return aIndex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetEdge
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
const IMeshData::IEdgePtr& BRepMeshData_Wire::GetEdge (
|
||||
const Standard_Integer theIndex) const
|
||||
{
|
||||
return myDEdges (theIndex);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function: GetEdgeOrientation
|
||||
// Purpose :
|
||||
//=======================================================================
|
||||
TopAbs_Orientation BRepMeshData_Wire::GetEdgeOrientation (
|
||||
const Standard_Integer theIndex) const
|
||||
{
|
||||
return myDEdgesOri (theIndex);
|
||||
}
|
63
src/BRepMeshData/BRepMeshData_Wire.hxx
Normal file
63
src/BRepMeshData/BRepMeshData_Wire.hxx
Normal file
@@ -0,0 +1,63 @@
|
||||
// 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 _BRepMeshData_Wire_HeaderFile
|
||||
#define _BRepMeshData_Wire_HeaderFile
|
||||
|
||||
#include <IMeshData_Wire.hxx>
|
||||
#include <IMeshData_Types.hxx>
|
||||
|
||||
//! Default implementation of wire data model entity.
|
||||
class BRepMeshData_Wire : public IMeshData_Wire
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_INC_ALLOC
|
||||
|
||||
//! Constructor.
|
||||
Standard_EXPORT BRepMeshData_Wire (
|
||||
const TopoDS_Wire& theWire,
|
||||
const Standard_Integer theEdgeNb,
|
||||
const Handle (NCollection_IncAllocator)& theAllocator);
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~BRepMeshData_Wire ();
|
||||
|
||||
//! Gets number of children.
|
||||
Standard_EXPORT virtual Standard_Integer EdgesNb () const Standard_OVERRIDE;
|
||||
|
||||
//! 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) Standard_OVERRIDE;
|
||||
|
||||
//! Gets edge with the given index.
|
||||
Standard_EXPORT virtual const IMeshData::IEdgePtr& GetEdge (
|
||||
const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns True if orientation of discrete edge with the given index is forward.
|
||||
Standard_EXPORT virtual TopAbs_Orientation GetEdgeOrientation (
|
||||
const Standard_Integer theIndex) const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Wire, IMeshData_Wire)
|
||||
|
||||
private:
|
||||
|
||||
IMeshData::VectorOfIEdgePtrs myDEdges;
|
||||
IMeshData::VectorOfOrientation myDEdgesOri;
|
||||
};
|
||||
|
||||
#endif
|
12
src/BRepMeshData/FILES
Normal file
12
src/BRepMeshData/FILES
Normal file
@@ -0,0 +1,12 @@
|
||||
BRepMeshData_Curve.cxx
|
||||
BRepMeshData_Curve.hxx
|
||||
BRepMeshData_Edge.cxx
|
||||
BRepMeshData_Edge.hxx
|
||||
BRepMeshData_Face.cxx
|
||||
BRepMeshData_Face.hxx
|
||||
BRepMeshData_Model.cxx
|
||||
BRepMeshData_Model.hxx
|
||||
BRepMeshData_PCurve.cxx
|
||||
BRepMeshData_PCurve.hxx
|
||||
BRepMeshData_Wire.cxx
|
||||
BRepMeshData_Wire.hxx
|
Reference in New Issue
Block a user