1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
oan
2014-07-10 14:51:15 +04:00
committed by apn
parent b6c0b841ec
commit fc9b36d630
109 changed files with 5266 additions and 6602 deletions

View File

@@ -0,0 +1,118 @@
// Copyright (c) 2013 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 _BRepMesh_DiscretFactory_HeaderFile
#define _BRepMesh_DiscretFactory_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <BRepMesh_PluginEntryType.hxx>
#include <BRepMesh_FactoryError.hxx>
#include <TColStd_MapOfAsciiString.hxx>
#include <TCollection_AsciiString.hxx>
#include <Plugin_MapOfFunctions.hxx>
#include <BRepMesh_DiscretRoot.hxx>
class TColStd_MapOfAsciiString;
class TCollection_AsciiString;
class BRepMesh_DiscretRoot;
class TopoDS_Shape;
//! This class intended to setup / retrieve default triangulation algorithm. <br>
//! Use BRepMesh_DiscretFactory::Get() static method to retrieve global Factory instance. <br>
//! Use BRepMesh_DiscretFactory::Discret() method to retrieve meshing tool. <br>
class BRepMesh_DiscretFactory
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the global factory instance.
Standard_EXPORT static BRepMesh_DiscretFactory& Get();
//! Returns the list of registered meshing algorithms.
inline const TColStd_MapOfAsciiString& Names() const
{
return myNames;
}
//! Setup meshing algorithm by name. <br>
//! Returns TRUE if requested tool is available. <br>
//! On fail Factory will continue to use previous algo.
Standard_EXPORT Standard_Boolean SetDefaultName(const TCollection_AsciiString& theName)
{
return SetDefault(theName, myFunctionName);
}
//! Returns name for current meshing algorithm.
inline const TCollection_AsciiString& DefaultName() const
{
return myDefaultName;
}
//! Advanced function. Changes function name to retrieve from plugin. <br>
//! Returns TRUE if requested tool is available. <br>
//! On fail Factory will continue to use previous algo.
Standard_EXPORT Standard_Boolean SetFunctionName(const TCollection_AsciiString& theFuncName)
{
return SetDefault(myDefaultName, theFuncName);
}
//! Returns function name that should be exported by plugin.
inline const TCollection_AsciiString& FunctionName() const
{
return myFunctionName;
}
//! Returns error status for last meshing algorithm switch.
inline BRepMesh_FactoryError ErrorStatus() const
{
return myErrorStatus;
}
//! Setup meshing algorithm that should be created by this Factory. <br>
//! Returns TRUE if requested tool is available. <br>
//! On fail Factory will continue to use previous algo. <br>
//! Call ::ErrorStatus() method to retrieve fault reason.
Standard_EXPORT Standard_Boolean SetDefault(const TCollection_AsciiString& theName,
const TCollection_AsciiString& theFuncName = "DISCRETALGO");
//! Returns triangulation algorithm instance.
//! \param theShape shape to be meshed.
//! \param theLinDeflection linear deflection to be used for meshing.
//! \param theAngDeflection angular deflection to be used for meshing.
Standard_EXPORT Handle(BRepMesh_DiscretRoot) Discret(const TopoDS_Shape& theShape,
const Standard_Real theLinDeflection,
const Standard_Real theAngDeflection);
protected:
//! Constructor
Standard_EXPORT BRepMesh_DiscretFactory();
//! Destructor
Standard_EXPORT virtual ~BRepMesh_DiscretFactory();
//! Clears factory data.
Standard_EXPORT void clear();
BRepMesh_PluginEntryType myPluginEntry;
BRepMesh_FactoryError myErrorStatus;
TColStd_MapOfAsciiString myNames;
TCollection_AsciiString myDefaultName;
TCollection_AsciiString myFunctionName;
Plugin_MapOfFunctions myFactoryMethods;
};
#endif