mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0025039: Improvement of code structure of general and supporting tools implemented in BRepMesh
Removed CDL declarations; Data collections are replaced by NCollections; Small code refactoring. Remove definition of BRepMesh class. Code refactoring of BRepMesh_IncrementalMesh. Function BRepMesh_Write storing BRepMesh_DataStructureOfDelaun to BRep file is added for debug needs. Static method BRepMesh_GeomTool::IntLinLin has been added to eliminate code duplications in BRepMesh_Dealun and BRepMesh_CircleTool. BRepMesh_CircleTool simplified method to find circumcircle. Fix merging conflicts Remove redundant function Fix compilation warning on MacOS Revert changes occurred during rebase Resolved merging conflicts Use parallel flag with BRepMesh_FastDiscret Test cases for issue CR25039_2
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepMesh_DiscretFactory.ixx>
|
||||
#include <BRepMesh_DiscretFactory.hxx>
|
||||
|
||||
#include <OSD_SharedLibrary.hxx>
|
||||
#include <OSD_Function.hxx>
|
||||
@@ -52,13 +52,13 @@ namespace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_DiscretFactory::BRepMesh_DiscretFactory()
|
||||
: myPluginEntry (NULL),
|
||||
myErrorStatus (BRepMesh_FE_NOERROR),
|
||||
myDefaultName (THE_FAST_DISCRET_MESH),
|
||||
: myPluginEntry (NULL),
|
||||
myErrorStatus (BRepMesh_FE_NOERROR),
|
||||
myDefaultName (THE_FAST_DISCRET_MESH),
|
||||
myFunctionName ("DISCRETALGO")
|
||||
{
|
||||
// register built-in meshing algorithms
|
||||
myNames.Add (THE_FAST_DISCRET_MESH);
|
||||
myNames.Add(THE_FAST_DISCRET_MESH);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -67,14 +67,14 @@ BRepMesh_DiscretFactory::BRepMesh_DiscretFactory()
|
||||
//=======================================================================
|
||||
BRepMesh_DiscretFactory::~BRepMesh_DiscretFactory()
|
||||
{
|
||||
Clear();
|
||||
clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//function : clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepMesh_DiscretFactory::Clear()
|
||||
void BRepMesh_DiscretFactory::clear()
|
||||
{
|
||||
// what should we do here? Unload dynamic libraries and reset plugins list?
|
||||
}
|
||||
@@ -90,66 +90,13 @@ BRepMesh_DiscretFactory& BRepMesh_DiscretFactory::Get()
|
||||
return THE_GLOBAL_FACTORY;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ErrorStatus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BRepMesh_FactoryError BRepMesh_DiscretFactory::ErrorStatus() const
|
||||
{
|
||||
return myErrorStatus;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Names
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TColStd_MapOfAsciiString& BRepMesh_DiscretFactory::Names() const
|
||||
{
|
||||
return myNames;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDefaultName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DiscretFactory::SetDefaultName (const TCollection_AsciiString& theName)
|
||||
{
|
||||
return SetDefault (theName, myFunctionName);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DefaultName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TCollection_AsciiString& BRepMesh_DiscretFactory::DefaultName() const
|
||||
{
|
||||
return myDefaultName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFunctionName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DiscretFactory::SetFunctionName (const TCollection_AsciiString& theFuncName)
|
||||
{
|
||||
return SetDefault (myDefaultName, theFuncName);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FunctionName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TCollection_AsciiString& BRepMesh_DiscretFactory::FunctionName() const
|
||||
{
|
||||
return myFunctionName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDefault
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepMesh_DiscretFactory::SetDefault (const TCollection_AsciiString& theName,
|
||||
const TCollection_AsciiString& theFuncName)
|
||||
Standard_Boolean BRepMesh_DiscretFactory::SetDefault(
|
||||
const TCollection_AsciiString& theName,
|
||||
const TCollection_AsciiString& theFuncName)
|
||||
{
|
||||
myErrorStatus = BRepMesh_FE_NOERROR;
|
||||
if (theName == THE_FAST_DISCRET_MESH)
|
||||
@@ -221,17 +168,19 @@ Standard_Boolean BRepMesh_DiscretFactory::SetDefault (const TCollection_AsciiStr
|
||||
//function : Discret
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(BRepMesh_DiscretRoot) BRepMesh_DiscretFactory
|
||||
::Discret (const TopoDS_Shape& theShape,
|
||||
const Standard_Real theDeflection,
|
||||
const Standard_Real theAngle)
|
||||
Handle(BRepMesh_DiscretRoot) BRepMesh_DiscretFactory::Discret(
|
||||
const TopoDS_Shape& theShape,
|
||||
const Standard_Real theDeflection,
|
||||
const Standard_Real theAngle)
|
||||
{
|
||||
Handle(BRepMesh_DiscretRoot) aDiscretRoot;
|
||||
BRepMesh_PDiscretRoot anInstancePtr = NULL;
|
||||
if (myPluginEntry != NULL)
|
||||
{
|
||||
// use plugin
|
||||
Standard_Integer anErr = myPluginEntry (theShape, theDeflection, theAngle, anInstancePtr);
|
||||
Standard_Integer anErr = myPluginEntry (theShape,
|
||||
theDeflection, theAngle, anInstancePtr);
|
||||
|
||||
if (anErr != 0 || anInstancePtr == NULL)
|
||||
{
|
||||
// can not create the algo specified - should never happens here
|
||||
@@ -242,7 +191,8 @@ Handle(BRepMesh_DiscretRoot) BRepMesh_DiscretFactory
|
||||
else //if (myDefaultName == THE_FAST_DISCRET_MESH)
|
||||
{
|
||||
// use built-in
|
||||
BRepMesh_IncrementalMesh::Discret (theShape, theDeflection, theAngle, anInstancePtr);
|
||||
BRepMesh_IncrementalMesh::Discret (theShape,
|
||||
theDeflection, theAngle, anInstancePtr);
|
||||
}
|
||||
|
||||
// cover with handle
|
||||
|
Reference in New Issue
Block a user