mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-28 22:08:25 +08:00
Modeling - Refactor BRepClass and FaceClassifier Implementation (#1167)
- Migrated `TopClass_FaceClassifier` / `TopClass_Classifier2d` implementations to `.pxx` and updated BRepClass/Geom2dHatch wrappers to use them (removing `_0.cxx` generator glue). - Updated BRep class helper headers to use header inlines instead of separate `.lxx` files, and added/rewired passive/face classifier implementations. - Extended `NCollection_DynamicArray` / `NCollection_KDTree` APIs (insert helpers, callback-based range query) and added GTests for the new vector insert operations.
This commit is contained in:
@@ -700,13 +700,42 @@ BRepCheck_Status BRepCheck_Edge::CheckPolygonOnTriangulation(const TopoDS_Edge&
|
||||
{
|
||||
NCollection_List<occ::handle<BRep_CurveRepresentation>>& aListOfCR =
|
||||
(*((occ::handle<BRep_TEdge>*)&theEdge.TShape()))->ChangeCurves();
|
||||
NCollection_List<occ::handle<BRep_CurveRepresentation>>::Iterator anITCR(aListOfCR);
|
||||
bool aHasPolygonOnTriangulation = false;
|
||||
bool aHasCurve3D = false;
|
||||
for (NCollection_List<occ::handle<BRep_CurveRepresentation>>::Iterator anITCR(aListOfCR);
|
||||
anITCR.More();
|
||||
anITCR.Next())
|
||||
{
|
||||
const occ::handle<BRep_CurveRepresentation>& aCR = anITCR.Value();
|
||||
if (aCR->IsPolygonOnTriangulation())
|
||||
{
|
||||
aHasPolygonOnTriangulation = true;
|
||||
}
|
||||
if (aCR->IsCurve3D() && !aCR->Curve3D().IsNull())
|
||||
{
|
||||
aHasCurve3D = true;
|
||||
}
|
||||
|
||||
if (aHasPolygonOnTriangulation && aHasCurve3D)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!aHasPolygonOnTriangulation || !aHasCurve3D)
|
||||
{
|
||||
return BRepCheck_NoError;
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve aBC;
|
||||
aBC.Initialize(theEdge);
|
||||
|
||||
if (!aBC.Is3DCurve())
|
||||
{
|
||||
return BRepCheck_NoError;
|
||||
}
|
||||
|
||||
NCollection_List<occ::handle<BRep_CurveRepresentation>>::Iterator anITCR(aListOfCR);
|
||||
|
||||
while (anITCR.More())
|
||||
{
|
||||
|
||||
@@ -41,12 +41,14 @@ public:
|
||||
Standard_EXPORT BRepClass_Edge(const TopoDS_Edge& E, const TopoDS_Face& F);
|
||||
|
||||
//! Returns the current Edge
|
||||
TopoDS_Edge& Edge();
|
||||
const TopoDS_Edge& Edge() const;
|
||||
TopoDS_Edge& Edge() { return myEdge; }
|
||||
|
||||
const TopoDS_Edge& Edge() const { return myEdge; }
|
||||
|
||||
//! Returns the Face for the current Edge
|
||||
TopoDS_Face& Face();
|
||||
const TopoDS_Face& Face() const;
|
||||
TopoDS_Face& Face() { return myFace; }
|
||||
|
||||
const TopoDS_Face& Face() const { return myFace; }
|
||||
|
||||
//! Returns the next Edge
|
||||
const TopoDS_Edge& NextEdge() const { return myNextEdge; }
|
||||
@@ -80,6 +82,4 @@ private:
|
||||
bool myUseBndBox;
|
||||
};
|
||||
|
||||
#include <BRepClass_Edge.lxx>
|
||||
|
||||
#endif // _BRepClass_Edge_HeaderFile
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
// Created on: 1992-11-19
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline TopoDS_Edge& BRepClass_Edge::Edge()
|
||||
{
|
||||
return myEdge;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline const TopoDS_Edge& BRepClass_Edge::Edge() const
|
||||
{
|
||||
return myEdge;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline TopoDS_Face& BRepClass_Edge::Face()
|
||||
{
|
||||
return myFace;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline const TopoDS_Face& BRepClass_Edge::Face() const
|
||||
{
|
||||
return myFace;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopClass_Classifier2d.pxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
BRepClass_FClass2dOfFClassifier::BRepClass_FClass2dOfFClassifier()
|
||||
: myIsSet(false),
|
||||
myFirstCompare(true),
|
||||
myFirstTrans(true),
|
||||
myParam(0.0),
|
||||
myTolerance(0.0),
|
||||
myClosest(0),
|
||||
myState(TopAbs_UNKNOWN),
|
||||
myIsHeadOrEnd(false)
|
||||
{
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepClass_FClass2dOfFClassifier::Reset(const gp_Lin2d& L, const double P, const double Tol)
|
||||
{
|
||||
TopClass_Classifier2d::Reset(myLin,
|
||||
myParam,
|
||||
myTolerance,
|
||||
myState,
|
||||
myFirstCompare,
|
||||
myFirstTrans,
|
||||
myClosest,
|
||||
myIsSet,
|
||||
myIsHeadOrEnd,
|
||||
L,
|
||||
P,
|
||||
Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepClass_FClass2dOfFClassifier::Compare(const BRepClass_Edge& E, const TopAbs_Orientation Or)
|
||||
{
|
||||
TopClass_Classifier2d::Compare(myClosest,
|
||||
myIntersector,
|
||||
myLin,
|
||||
myParam,
|
||||
myTolerance,
|
||||
myState,
|
||||
myFirstCompare,
|
||||
myFirstTrans,
|
||||
myTrans,
|
||||
myIsHeadOrEnd,
|
||||
E,
|
||||
Or);
|
||||
}
|
||||
@@ -50,24 +50,24 @@ public:
|
||||
Standard_EXPORT void Compare(const BRepClass_Edge& E, const TopAbs_Orientation Or);
|
||||
|
||||
//! Returns the current value of the parameter.
|
||||
double Parameter() const;
|
||||
double Parameter() const { return myParam; }
|
||||
|
||||
//! Returns the intersecting algorithm.
|
||||
BRepClass_Intersector& Intersector();
|
||||
BRepClass_Intersector& Intersector() { return myIntersector; }
|
||||
|
||||
//! Returns 0 if the last compared edge had no
|
||||
//! relevant intersection. Else returns the index of
|
||||
//! this intersection in the last intersection
|
||||
//! algorithm.
|
||||
int ClosestIntersection() const;
|
||||
int ClosestIntersection() const { return myClosest; }
|
||||
|
||||
//! Returns the current state of the point.
|
||||
TopAbs_State State() const;
|
||||
TopAbs_State State() const { return myState; }
|
||||
|
||||
//! Returns the true if the closest intersection point
|
||||
//! represents head or end of the edge. Returns false
|
||||
//! otherwise.
|
||||
bool IsHeadOrEnd() const;
|
||||
bool IsHeadOrEnd() const { return myIsHeadOrEnd; }
|
||||
|
||||
private:
|
||||
bool myIsSet;
|
||||
@@ -83,20 +83,4 @@ private:
|
||||
bool myIsHeadOrEnd;
|
||||
};
|
||||
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersector BRepClass_Intersector
|
||||
#define TheIntersector_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_Classifier2d BRepClass_FClass2dOfFClassifier
|
||||
#define TopClass_Classifier2d_hxx <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
|
||||
#include <TopClass_Classifier2d.lxx>
|
||||
|
||||
#undef TheEdge
|
||||
#undef TheEdge_hxx
|
||||
#undef TheIntersector
|
||||
#undef TheIntersector_hxx
|
||||
#undef TopClass_Classifier2d
|
||||
#undef TopClass_Classifier2d_hxx
|
||||
|
||||
#endif // _BRepClass_FClass2dOfFClassifier_HeaderFile
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersector BRepClass_Intersector
|
||||
#define TheIntersector_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_Classifier2d BRepClass_FClass2dOfFClassifier
|
||||
#define TopClass_Classifier2d_hxx <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
#include <TopClass_Classifier2d.gxx>
|
||||
@@ -0,0 +1,82 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FClassifier.hxx>
|
||||
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
#include <BRepClass_FaceExplorer.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopClass_FaceClassifier.pxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
BRepClass_FClassifier::BRepClass_FClassifier()
|
||||
: myEdgeParameter(0.0),
|
||||
rejected(false),
|
||||
nowires(true)
|
||||
{
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
BRepClass_FClassifier::BRepClass_FClassifier(BRepClass_FaceExplorer& F,
|
||||
const gp_Pnt2d& P,
|
||||
const double Tol)
|
||||
: myEdgeParameter(0.0),
|
||||
rejected(false),
|
||||
nowires(true)
|
||||
{
|
||||
Perform(F, P, Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepClass_FClassifier::Perform(BRepClass_FaceExplorer& F, const gp_Pnt2d& P, const double Tol)
|
||||
{
|
||||
TopClass_FaceClassifier::Perform(rejected,
|
||||
nowires,
|
||||
myClassifier,
|
||||
myEdge,
|
||||
myPosition,
|
||||
myEdgeParameter,
|
||||
F,
|
||||
P,
|
||||
Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
TopAbs_State BRepClass_FClassifier::State() const
|
||||
{
|
||||
return TopClass_FaceClassifier::State(rejected, nowires, myClassifier);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
const BRepClass_Edge& BRepClass_FClassifier::Edge() const
|
||||
{
|
||||
return TopClass_FaceClassifier::Edge(rejected, myEdge);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
double BRepClass_FClassifier::EdgeParameter() const
|
||||
{
|
||||
return TopClass_FaceClassifier::EdgeParameter(rejected, myEdgeParameter);
|
||||
}
|
||||
@@ -54,11 +54,11 @@ public:
|
||||
|
||||
//! Returns True when the state was computed by a
|
||||
//! rejection. The state is OUT.
|
||||
bool Rejected() const;
|
||||
bool Rejected() const { return rejected; }
|
||||
|
||||
//! Returns True if the face contains no wire. The
|
||||
//! state is IN.
|
||||
bool NoWires() const;
|
||||
bool NoWires() const { return nowires; }
|
||||
|
||||
//! Returns the Edge used to determine the
|
||||
//! classification. When the State is ON this is the
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
//! Returns the position of the point on the edge
|
||||
//! returned by Edge.
|
||||
IntRes2d_Position Position() const;
|
||||
IntRes2d_Position Position() const { return myPosition; }
|
||||
|
||||
protected:
|
||||
BRepClass_FClass2dOfFClassifier myClassifier;
|
||||
@@ -82,28 +82,4 @@ protected:
|
||||
bool nowires;
|
||||
};
|
||||
|
||||
#define TheFaceExplorer BRepClass_FaceExplorer
|
||||
#define TheFaceExplorer_hxx <BRepClass_FaceExplorer.hxx>
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersection2d BRepClass_Intersector
|
||||
#define TheIntersection2d_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_FClass2d BRepClass_FClass2dOfFClassifier
|
||||
#define TopClass_FClass2d_hxx <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
#define TopClass_FaceClassifier BRepClass_FClassifier
|
||||
#define TopClass_FaceClassifier_hxx <BRepClass_FClassifier.hxx>
|
||||
|
||||
#include <TopClass_FaceClassifier.lxx>
|
||||
|
||||
#undef TheFaceExplorer
|
||||
#undef TheFaceExplorer_hxx
|
||||
#undef TheEdge
|
||||
#undef TheEdge_hxx
|
||||
#undef TheIntersection2d
|
||||
#undef TheIntersection2d_hxx
|
||||
#undef TopClass_FClass2d
|
||||
#undef TopClass_FClass2d_hxx
|
||||
#undef TopClass_FaceClassifier
|
||||
#undef TopClass_FaceClassifier_hxx
|
||||
|
||||
#endif // _BRepClass_FClassifier_HeaderFile
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FClassifier.hxx>
|
||||
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <BRepClass_FaceExplorer.hxx>
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
|
||||
#define TheFaceExplorer BRepClass_FaceExplorer
|
||||
#define TheFaceExplorer_hxx <BRepClass_FaceExplorer.hxx>
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersection2d BRepClass_Intersector
|
||||
#define TheIntersection2d_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_FClass2d BRepClass_FClass2dOfFClassifier
|
||||
#define TopClass_FClass2d_hxx <BRepClass_FClass2dOfFClassifier.hxx>
|
||||
#define TopClass_FaceClassifier BRepClass_FClassifier
|
||||
#define TopClass_FaceClassifier_hxx <BRepClass_FClassifier.hxx>
|
||||
#include <TopClass_FaceClassifier.gxx>
|
||||
@@ -65,10 +65,10 @@ public:
|
||||
Standard_EXPORT void InitWires();
|
||||
|
||||
//! Returns True if there is a current wire.
|
||||
bool MoreWires() const;
|
||||
bool MoreWires() const { return myWExplorer.More(); }
|
||||
|
||||
//! Sets the explorer to the next wire.
|
||||
void NextWire();
|
||||
void NextWire() { myWExplorer.Next(); }
|
||||
|
||||
//! Returns True if the wire bounding volume does not
|
||||
//! intersect the segment.
|
||||
@@ -79,10 +79,10 @@ public:
|
||||
Standard_EXPORT void InitEdges();
|
||||
|
||||
//! Returns True if there is a current edge.
|
||||
bool MoreEdges() const;
|
||||
bool MoreEdges() const { return myEExplorer.More(); }
|
||||
|
||||
//! Sets the explorer to the next edge.
|
||||
void NextEdge();
|
||||
void NextEdge() { myEExplorer.Next(); }
|
||||
|
||||
//! Returns True if the edge bounding volume does not
|
||||
//! intersect the segment.
|
||||
@@ -127,6 +127,4 @@ private:
|
||||
double myVMax;
|
||||
};
|
||||
|
||||
#include <BRepClass_FaceExplorer.lxx>
|
||||
|
||||
#endif // _BRepClass_FaceExplorer_HeaderFile
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
// Created on: 1993-01-25
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline bool BRepClass_FaceExplorer::MoreWires() const
|
||||
{
|
||||
return myWExplorer.More();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline void BRepClass_FaceExplorer::NextWire()
|
||||
{
|
||||
myWExplorer.Next();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline bool BRepClass_FaceExplorer::MoreEdges() const
|
||||
{
|
||||
return myEExplorer.More();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
inline void BRepClass_FaceExplorer::NextEdge()
|
||||
{
|
||||
myEExplorer.Next();
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FacePassiveClassifier.hxx>
|
||||
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopClass_Classifier2d.pxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
BRepClass_FacePassiveClassifier::BRepClass_FacePassiveClassifier()
|
||||
: myIsSet(false),
|
||||
myFirstCompare(true),
|
||||
myFirstTrans(true),
|
||||
myParam(0.0),
|
||||
myTolerance(0.0),
|
||||
myClosest(0),
|
||||
myState(TopAbs_UNKNOWN),
|
||||
myIsHeadOrEnd(false)
|
||||
{
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepClass_FacePassiveClassifier::Reset(const gp_Lin2d& L, const double P, const double Tol)
|
||||
{
|
||||
TopClass_Classifier2d::Reset(myLin,
|
||||
myParam,
|
||||
myTolerance,
|
||||
myState,
|
||||
myFirstCompare,
|
||||
myFirstTrans,
|
||||
myClosest,
|
||||
myIsSet,
|
||||
myIsHeadOrEnd,
|
||||
L,
|
||||
P,
|
||||
Tol);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepClass_FacePassiveClassifier::Compare(const BRepClass_Edge& E, const TopAbs_Orientation Or)
|
||||
{
|
||||
TopClass_Classifier2d::Compare(myClosest,
|
||||
myIntersector,
|
||||
myLin,
|
||||
myParam,
|
||||
myTolerance,
|
||||
myState,
|
||||
myFirstCompare,
|
||||
myFirstTrans,
|
||||
myTrans,
|
||||
myIsHeadOrEnd,
|
||||
E,
|
||||
Or);
|
||||
}
|
||||
@@ -51,24 +51,24 @@ public:
|
||||
Standard_EXPORT void Compare(const BRepClass_Edge& E, const TopAbs_Orientation Or);
|
||||
|
||||
//! Returns the current value of the parameter.
|
||||
double Parameter() const;
|
||||
double Parameter() const { return myParam; }
|
||||
|
||||
//! Returns the intersecting algorithm.
|
||||
BRepClass_Intersector& Intersector();
|
||||
BRepClass_Intersector& Intersector() { return myIntersector; }
|
||||
|
||||
//! Returns 0 if the last compared edge had no
|
||||
//! relevant intersection. Else returns the index of
|
||||
//! this intersection in the last intersection
|
||||
//! algorithm.
|
||||
int ClosestIntersection() const;
|
||||
int ClosestIntersection() const { return myClosest; }
|
||||
|
||||
//! Returns the current state of the point.
|
||||
TopAbs_State State() const;
|
||||
TopAbs_State State() const { return myState; }
|
||||
|
||||
//! Returns the true if the closest intersection point
|
||||
//! represents head or end of the edge. Returns false
|
||||
//! otherwise.
|
||||
bool IsHeadOrEnd() const;
|
||||
bool IsHeadOrEnd() const { return myIsHeadOrEnd; }
|
||||
|
||||
private:
|
||||
bool myIsSet;
|
||||
@@ -84,20 +84,4 @@ private:
|
||||
bool myIsHeadOrEnd;
|
||||
};
|
||||
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersector BRepClass_Intersector
|
||||
#define TheIntersector_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_Classifier2d BRepClass_FacePassiveClassifier
|
||||
#define TopClass_Classifier2d_hxx <BRepClass_FacePassiveClassifier.hxx>
|
||||
|
||||
#include <TopClass_Classifier2d.lxx>
|
||||
|
||||
#undef TheEdge
|
||||
#undef TheEdge_hxx
|
||||
#undef TheIntersector
|
||||
#undef TheIntersector_hxx
|
||||
#undef TopClass_Classifier2d
|
||||
#undef TopClass_Classifier2d_hxx
|
||||
|
||||
#endif // _BRepClass_FacePassiveClassifier_HeaderFile
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Created on: 1992-11-18
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
#include <BRepClass_FacePassiveClassifier.hxx>
|
||||
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <BRepClass_Edge.hxx>
|
||||
#include <BRepClass_Intersector.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
|
||||
#define TheEdge BRepClass_Edge
|
||||
#define TheEdge_hxx <BRepClass_Edge.hxx>
|
||||
#define TheIntersector BRepClass_Intersector
|
||||
#define TheIntersector_hxx <BRepClass_Intersector.hxx>
|
||||
#define TopClass_Classifier2d BRepClass_FacePassiveClassifier
|
||||
#define TopClass_Classifier2d_hxx <BRepClass_FacePassiveClassifier.hxx>
|
||||
#include <TopClass_Classifier2d.gxx>
|
||||
@@ -4,18 +4,16 @@ set(OCCT_BRepClass_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}")
|
||||
set(OCCT_BRepClass_FILES
|
||||
BRepClass_Edge.cxx
|
||||
BRepClass_Edge.hxx
|
||||
BRepClass_Edge.lxx
|
||||
BRepClass_FaceClassifier.cxx
|
||||
BRepClass_FaceClassifier.hxx
|
||||
BRepClass_FaceExplorer.cxx
|
||||
BRepClass_FaceExplorer.hxx
|
||||
BRepClass_FaceExplorer.lxx
|
||||
BRepClass_FacePassiveClassifier.cxx
|
||||
BRepClass_FacePassiveClassifier.hxx
|
||||
BRepClass_FacePassiveClassifier_0.cxx
|
||||
BRepClass_FClass2dOfFClassifier.cxx
|
||||
BRepClass_FClass2dOfFClassifier.hxx
|
||||
BRepClass_FClass2dOfFClassifier_0.cxx
|
||||
BRepClass_FClassifier.cxx
|
||||
BRepClass_FClassifier.hxx
|
||||
BRepClass_FClassifier_0.cxx
|
||||
BRepClass_Intersector.cxx
|
||||
BRepClass_Intersector.hxx
|
||||
)
|
||||
|
||||
@@ -82,15 +82,16 @@ bool BRepClass3d_SolidExplorer::FindAPointInTheFace(const TopoDS_Face& _face,
|
||||
TopoDS_Face face = _face;
|
||||
face.Orientation(TopAbs_FORWARD);
|
||||
|
||||
TopExp_Explorer faceexplorer;
|
||||
BRepAdaptor_Curve2d c;
|
||||
gp_Vec2d T;
|
||||
gp_Pnt2d P;
|
||||
gp_Vec2d T;
|
||||
gp_Pnt2d P;
|
||||
|
||||
for (faceexplorer.Init(face, TopAbs_EDGE); faceexplorer.More(); faceexplorer.Next())
|
||||
for (TopExp_Explorer faceexplorer(face, TopAbs_EDGE); faceexplorer.More(); faceexplorer.Next())
|
||||
{
|
||||
TopoDS_Edge Edge = TopoDS::Edge(faceexplorer.Current());
|
||||
c.Initialize(Edge, face);
|
||||
TopoDS_Edge Edge = TopoDS::Edge(faceexplorer.Current());
|
||||
BRepAdaptor_Curve2d c(Edge, face);
|
||||
if (c.Curve().IsNull())
|
||||
continue;
|
||||
|
||||
c.D1((c.LastParameter() - c.FirstParameter()) * param_ + c.FirstParameter(), P, T);
|
||||
|
||||
double x = T.X();
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRepExtrema_ExtPC.hxx>
|
||||
#include <BRepExtrema_ExtPF.hxx>
|
||||
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
Standard_EXPORT BRepTopAdaptor_HVertex(const TopoDS_Vertex& Vtx,
|
||||
const occ::handle<BRepAdaptor_Curve2d>& Curve);
|
||||
|
||||
const TopoDS_Vertex& Vertex() const;
|
||||
const TopoDS_Vertex& Vertex() const { return myVtx; }
|
||||
|
||||
TopoDS_Vertex& ChangeVertex();
|
||||
TopoDS_Vertex& ChangeVertex() { return myVtx; }
|
||||
|
||||
Standard_EXPORT gp_Pnt2d Value() override;
|
||||
|
||||
@@ -55,6 +55,4 @@ private:
|
||||
occ::handle<BRepAdaptor_Curve2d> myCurve;
|
||||
};
|
||||
|
||||
#include <BRepTopAdaptor_HVertex.lxx>
|
||||
|
||||
#endif // _BRepTopAdaptor_HVertex_HeaderFile
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-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.
|
||||
|
||||
inline const TopoDS_Vertex& BRepTopAdaptor_HVertex::Vertex() const
|
||||
{
|
||||
return myVtx;
|
||||
}
|
||||
|
||||
inline TopoDS_Vertex& BRepTopAdaptor_HVertex::ChangeVertex()
|
||||
{
|
||||
return myVtx;
|
||||
}
|
||||
@@ -7,7 +7,6 @@ set(OCCT_BRepTopAdaptor_FILES
|
||||
BRepTopAdaptor_FClass2d.hxx
|
||||
BRepTopAdaptor_HVertex.cxx
|
||||
BRepTopAdaptor_HVertex.hxx
|
||||
BRepTopAdaptor_HVertex.lxx
|
||||
|
||||
BRepTopAdaptor_Tool.cxx
|
||||
BRepTopAdaptor_Tool.hxx
|
||||
|
||||
Reference in New Issue
Block a user