mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-25 09:07:26 +08:00
Coding - Revert type definitions for Standard_CString replacements (#1021)
Fix the replacement issue when Standard_CString was replaced to const char* even when it was const. Now "const Standard_CString" is replaced with "const char* const". Only places which were before const Standard_CString is replaced.
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
||||
const TopoDS_Shape& Shape() const { return myResult; }
|
||||
|
||||
//! Sets directory where the debug shapes will be saved
|
||||
void SetTemporaryDirectory(const char*& thePath) { myDebugShapesPath = thePath; }
|
||||
void SetTemporaryDirectory(const char* const thePath) { myDebugShapesPath = thePath; }
|
||||
|
||||
//! Sets/Unsets computation in parallel mode
|
||||
void SetParallelMode(const bool theVal) { myIsParallel = theVal; }
|
||||
|
||||
@@ -491,7 +491,7 @@ Standard_OStream& TopOpeBRepDS_Check::PrintIntg(Standard_OStream& OS)
|
||||
|
||||
Standard_OStream& TopOpeBRepDS_Check::PrintMap(
|
||||
NCollection_DataMap<int, TopOpeBRepDS_CheckStatus>& MapStat,
|
||||
const char* eltstr,
|
||||
const char* const eltstr,
|
||||
Standard_OStream& OS)
|
||||
{
|
||||
NCollection_DataMap<int, TopOpeBRepDS_CheckStatus>::Iterator DMI(MapStat);
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
private:
|
||||
Standard_EXPORT Standard_OStream& PrintMap(
|
||||
NCollection_DataMap<int, TopOpeBRepDS_CheckStatus>& MapStat,
|
||||
const char* eltstr,
|
||||
const char* const eltstr,
|
||||
Standard_OStream& S);
|
||||
|
||||
Standard_EXPORT Standard_OStream& PrintElts(
|
||||
|
||||
@@ -301,7 +301,7 @@ Handle(IMeshData::MapOfInteger) BRepMesh_MeshTool::GetEdgesByType(
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void BRepMesh_MeshTool::DumpTriangles(const char* theFileName,
|
||||
void BRepMesh_MeshTool::DumpTriangles(const char* const theFileName,
|
||||
IMeshData::MapOfInteger* theTriangles)
|
||||
{
|
||||
BRep_Builder aBuilder;
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
const occ::handle<BRepMesh_DataStructureOfDelaun>& GetStructure() const { return myStructure; }
|
||||
|
||||
//! Dumps triangles to specified file.
|
||||
void DumpTriangles(const char* theFileName, IMeshData::MapOfInteger* theTriangles);
|
||||
void DumpTriangles(const char* const theFileName, IMeshData::MapOfInteger* theTriangles);
|
||||
|
||||
//! Adds new triangle with specified nodes to mesh.
|
||||
//! Legalizes triangle in case if it violates circle criteria.
|
||||
|
||||
@@ -56,7 +56,8 @@ private:
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess::RegisterOperator(const char* name, const occ::handle<ShapeProcess_Operator>& op)
|
||||
bool ShapeProcess::RegisterOperator(const char* const name,
|
||||
const occ::handle<ShapeProcess_Operator>& op)
|
||||
{
|
||||
if (aMapOfOperators.IsBound(name))
|
||||
{
|
||||
@@ -71,7 +72,7 @@ bool ShapeProcess::RegisterOperator(const char* name, const occ::handle<ShapePro
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess::FindOperator(const char* name, occ::handle<ShapeProcess_Operator>& op)
|
||||
bool ShapeProcess::FindOperator(const char* const name, occ::handle<ShapeProcess_Operator>& op)
|
||||
{
|
||||
if (!aMapOfOperators.IsBound(name))
|
||||
{
|
||||
@@ -87,7 +88,7 @@ bool ShapeProcess::FindOperator(const char* name, occ::handle<ShapeProcess_Opera
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess::Perform(const occ::handle<ShapeProcess_Context>& context,
|
||||
const char* seq,
|
||||
const char* const seq,
|
||||
const Message_ProgressRange& theProgress)
|
||||
{
|
||||
ScopeLock aSequenceScope(*context, seq);
|
||||
|
||||
@@ -74,11 +74,11 @@ public:
|
||||
|
||||
public:
|
||||
//! Registers operator to make it visible for Performer
|
||||
Standard_EXPORT static bool RegisterOperator(const char* name,
|
||||
Standard_EXPORT static bool RegisterOperator(const char* const name,
|
||||
const occ::handle<ShapeProcess_Operator>& op);
|
||||
|
||||
//! Finds operator by its name
|
||||
Standard_EXPORT static bool FindOperator(const char* name,
|
||||
Standard_EXPORT static bool FindOperator(const char* const name,
|
||||
occ::handle<ShapeProcess_Operator>& op);
|
||||
|
||||
//! Performs a specified sequence of operators on Context
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
//! to Context (including description of sequence seq)
|
||||
Standard_EXPORT static bool Perform(
|
||||
const occ::handle<ShapeProcess_Context>& context,
|
||||
const char* seq,
|
||||
const char* const seq,
|
||||
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||
|
||||
//! Performs a specified sequence of operators on @p theContext.
|
||||
|
||||
@@ -47,7 +47,7 @@ ShapeProcess_Context::ShapeProcess_Context()
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
ShapeProcess_Context::ShapeProcess_Context(const char* file, const char* scope)
|
||||
ShapeProcess_Context::ShapeProcess_Context(const char* const file, const char* const scope)
|
||||
{
|
||||
Init(file, scope);
|
||||
myMessenger = Message::DefaultMessenger();
|
||||
@@ -56,7 +56,7 @@ ShapeProcess_Context::ShapeProcess_Context(const char* file, const char* scope)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::Init(const char* file, const char* scope)
|
||||
bool ShapeProcess_Context::Init(const char* const file, const char* const scope)
|
||||
{
|
||||
myScope.Nullify();
|
||||
if (file != nullptr && strlen(file) != 0)
|
||||
@@ -76,7 +76,7 @@ bool ShapeProcess_Context::Init(const char* file, const char* scope)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
occ::handle<Resource_Manager> ShapeProcess_Context::LoadResourceManager(const char* name)
|
||||
occ::handle<Resource_Manager> ShapeProcess_Context::LoadResourceManager(const char* const name)
|
||||
{
|
||||
// Mutex is needed because we are initializing and changing static variables here, so
|
||||
// without mutex it leads to race condition.
|
||||
@@ -153,7 +153,7 @@ const occ::handle<Resource_Manager>& ShapeProcess_Context::ResourceManager() con
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void ShapeProcess_Context::SetScope(const char* scope)
|
||||
void ShapeProcess_Context::SetScope(const char* const scope)
|
||||
{
|
||||
if (myScope.IsNull())
|
||||
myScope = new NCollection_HSequence<occ::handle<TCollection_HAsciiString>>;
|
||||
@@ -181,7 +181,7 @@ void ShapeProcess_Context::UnSetScope()
|
||||
|
||||
static occ::handle<TCollection_HAsciiString> MakeName(
|
||||
const occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>>& scope,
|
||||
const char* param)
|
||||
const char* const param)
|
||||
{
|
||||
occ::handle<TCollection_HAsciiString> str;
|
||||
if (!scope.IsNull() && scope->Length() > 0)
|
||||
@@ -195,14 +195,14 @@ static occ::handle<TCollection_HAsciiString> MakeName(
|
||||
return str;
|
||||
}
|
||||
|
||||
bool ShapeProcess_Context::IsParamSet(const char* param) const
|
||||
bool ShapeProcess_Context::IsParamSet(const char* const param) const
|
||||
{
|
||||
return !myRC.IsNull() && myRC->Find(MakeName(myScope, param)->ToCString());
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::GetString(const char* param, TCollection_AsciiString& str) const
|
||||
bool ShapeProcess_Context::GetString(const char* const param, TCollection_AsciiString& str) const
|
||||
{
|
||||
if (myRC.IsNull())
|
||||
return false;
|
||||
@@ -221,7 +221,7 @@ bool ShapeProcess_Context::GetString(const char* param, TCollection_AsciiString&
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::GetReal(const char* param, double& val) const
|
||||
bool ShapeProcess_Context::GetReal(const char* const param, double& val) const
|
||||
{
|
||||
if (myRC.IsNull())
|
||||
return false;
|
||||
@@ -267,7 +267,7 @@ bool ShapeProcess_Context::GetReal(const char* param, double& val) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::GetInteger(const char* param, int& val) const
|
||||
bool ShapeProcess_Context::GetInteger(const char* const param, int& val) const
|
||||
{
|
||||
if (myRC.IsNull())
|
||||
return false;
|
||||
@@ -313,7 +313,7 @@ bool ShapeProcess_Context::GetInteger(const char* param, int& val) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::GetBoolean(const char* param, bool& val) const
|
||||
bool ShapeProcess_Context::GetBoolean(const char* const param, bool& val) const
|
||||
{
|
||||
if (myRC.IsNull())
|
||||
return false;
|
||||
@@ -337,7 +337,7 @@ bool ShapeProcess_Context::GetBoolean(const char* param, bool& val) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
double ShapeProcess_Context::RealVal(const char* param, const double def) const
|
||||
double ShapeProcess_Context::RealVal(const char* const param, const double def) const
|
||||
{
|
||||
double val;
|
||||
return GetReal(param, val) ? val : def;
|
||||
@@ -345,7 +345,7 @@ double ShapeProcess_Context::RealVal(const char* param, const double def) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_Context::BooleanVal(const char* param, const bool def) const
|
||||
bool ShapeProcess_Context::BooleanVal(const char* const param, const bool def) const
|
||||
{
|
||||
bool val;
|
||||
return GetBoolean(param, val) ? val : def;
|
||||
@@ -353,7 +353,7 @@ bool ShapeProcess_Context::BooleanVal(const char* param, const bool def) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
int ShapeProcess_Context::IntegerVal(const char* param, const int def) const
|
||||
int ShapeProcess_Context::IntegerVal(const char* const param, const int def) const
|
||||
{
|
||||
int val;
|
||||
return GetInteger(param, val) ? val : def;
|
||||
@@ -361,7 +361,7 @@ int ShapeProcess_Context::IntegerVal(const char* param, const int def) const
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
const char* ShapeProcess_Context::StringVal(const char* param, const char* def) const
|
||||
const char* ShapeProcess_Context::StringVal(const char* const param, const char* const def) const
|
||||
{
|
||||
if (myRC.IsNull())
|
||||
return def;
|
||||
|
||||
@@ -44,50 +44,50 @@ public:
|
||||
//! Creates a new tool and initialises by name of
|
||||
//! resource file and (if specified) starting scope
|
||||
//! Calls method Init()
|
||||
Standard_EXPORT ShapeProcess_Context(const char* file, const char* scope = "");
|
||||
Standard_EXPORT ShapeProcess_Context(const char* const file, const char* const scope = "");
|
||||
|
||||
//! Initialises a tool by loading resource file and
|
||||
//! (if specified) sets starting scope
|
||||
//! Returns False if resource file not found
|
||||
Standard_EXPORT bool Init(const char* file, const char* scope = "");
|
||||
Standard_EXPORT bool Init(const char* const file, const char* const scope = "");
|
||||
|
||||
//! Loading Resource_Manager object if this object not
|
||||
//! equal internal static Resource_Manager object or
|
||||
//! internal static Resource_Manager object is null
|
||||
Standard_EXPORT occ::handle<Resource_Manager> LoadResourceManager(const char* file);
|
||||
Standard_EXPORT occ::handle<Resource_Manager> LoadResourceManager(const char* const file);
|
||||
|
||||
//! Returns internal Resource_Manager object
|
||||
Standard_EXPORT const occ::handle<Resource_Manager>& ResourceManager() const;
|
||||
|
||||
//! Set a new (sub)scope
|
||||
Standard_EXPORT void SetScope(const char* scope);
|
||||
Standard_EXPORT void SetScope(const char* const scope);
|
||||
|
||||
//! Go out of current scope
|
||||
Standard_EXPORT void UnSetScope();
|
||||
|
||||
//! Returns True if parameter is defined in the resource file
|
||||
Standard_EXPORT bool IsParamSet(const char* param) const;
|
||||
Standard_EXPORT bool IsParamSet(const char* const param) const;
|
||||
|
||||
Standard_EXPORT bool GetReal(const char* param, double& val) const;
|
||||
Standard_EXPORT bool GetReal(const char* const param, double& val) const;
|
||||
|
||||
Standard_EXPORT bool GetInteger(const char* param, int& val) const;
|
||||
Standard_EXPORT bool GetInteger(const char* const param, int& val) const;
|
||||
|
||||
Standard_EXPORT bool GetBoolean(const char* param, bool& val) const;
|
||||
Standard_EXPORT bool GetBoolean(const char* const param, bool& val) const;
|
||||
|
||||
//! Get value of parameter as being of specific type
|
||||
//! Returns False if parameter is not defined or has a wrong type
|
||||
Standard_EXPORT bool GetString(const char* param, TCollection_AsciiString& val) const;
|
||||
Standard_EXPORT bool GetString(const char* const param, TCollection_AsciiString& val) const;
|
||||
|
||||
Standard_EXPORT double RealVal(const char* param, const double def) const;
|
||||
Standard_EXPORT double RealVal(const char* const param, const double def) const;
|
||||
|
||||
Standard_EXPORT int IntegerVal(const char* param, const int def) const;
|
||||
Standard_EXPORT int IntegerVal(const char* const param, const int def) const;
|
||||
|
||||
Standard_EXPORT bool BooleanVal(const char* param, const bool def) const;
|
||||
Standard_EXPORT bool BooleanVal(const char* const param, const bool def) const;
|
||||
|
||||
//! Get value of parameter as being of specific type
|
||||
//! If parameter is not defined or does not have expected
|
||||
//! type, returns default value as specified
|
||||
Standard_EXPORT const char* StringVal(const char* param, const char* def) const;
|
||||
Standard_EXPORT const char* StringVal(const char* const param, const char* const def) const;
|
||||
|
||||
//! Sets Messenger used for outputting messages.
|
||||
Standard_EXPORT void SetMessenger(const occ::handle<Message_Messenger>& messenger);
|
||||
|
||||
@@ -29,7 +29,7 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_ShapeContext, ShapeProcess_Context)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext(const char* file, const char* seq)
|
||||
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext(const char* const file, const char* const seq)
|
||||
: ShapeProcess_Context(file, seq),
|
||||
myUntil(TopAbs_FACE),
|
||||
myNonManifold(false)
|
||||
@@ -39,8 +39,8 @@ ShapeProcess_ShapeContext::ShapeProcess_ShapeContext(const char* file, const cha
|
||||
//=================================================================================================
|
||||
|
||||
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext(const TopoDS_Shape& S,
|
||||
const char* file,
|
||||
const char* seq)
|
||||
const char* const file,
|
||||
const char* const seq)
|
||||
: ShapeProcess_Context(file, seq),
|
||||
myUntil(TopAbs_FACE),
|
||||
myNonManifold(false)
|
||||
@@ -374,7 +374,7 @@ void ShapeProcess_ShapeContext::RecordModification(
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool ShapeProcess_ShapeContext::GetContinuity(const char* param, GeomAbs_Shape& cont) const
|
||||
bool ShapeProcess_ShapeContext::GetContinuity(const char* const param, GeomAbs_Shape& cont) const
|
||||
{
|
||||
TCollection_AsciiString str;
|
||||
if (!GetString(param, str))
|
||||
@@ -405,7 +405,7 @@ bool ShapeProcess_ShapeContext::GetContinuity(const char* param, GeomAbs_Shape&
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
GeomAbs_Shape ShapeProcess_ShapeContext::ContinuityVal(const char* param,
|
||||
GeomAbs_Shape ShapeProcess_ShapeContext::ContinuityVal(const char* const param,
|
||||
const GeomAbs_Shape def) const
|
||||
{
|
||||
GeomAbs_Shape val;
|
||||
|
||||
@@ -38,13 +38,13 @@ class ShapeProcess_ShapeContext : public ShapeProcess_Context
|
||||
{
|
||||
|
||||
public:
|
||||
Standard_EXPORT ShapeProcess_ShapeContext(const char* file, const char* seq = "");
|
||||
Standard_EXPORT ShapeProcess_ShapeContext(const char* const file, const char* const seq = "");
|
||||
|
||||
//! Initializes a tool by resource file and shape
|
||||
//! to be processed
|
||||
Standard_EXPORT ShapeProcess_ShapeContext(const TopoDS_Shape& S,
|
||||
const char* file,
|
||||
const char* seq = "");
|
||||
const char* const file,
|
||||
const char* const seq = "");
|
||||
|
||||
//! Initializes tool by a new shape and clears all results
|
||||
Standard_EXPORT void Init(const TopoDS_Shape& S);
|
||||
@@ -119,12 +119,13 @@ public:
|
||||
|
||||
//! Get value of parameter as being of the type GeomAbs_Shape
|
||||
//! Returns False if parameter is not defined or has a wrong type
|
||||
Standard_EXPORT bool GetContinuity(const char* param, GeomAbs_Shape& val) const;
|
||||
Standard_EXPORT bool GetContinuity(const char* const param, GeomAbs_Shape& val) const;
|
||||
|
||||
//! Get value of parameter as being of the type GeomAbs_Shape
|
||||
//! If parameter is not defined or does not have expected
|
||||
//! type, returns default value as specified
|
||||
Standard_EXPORT GeomAbs_Shape ContinuityVal(const char* param, const GeomAbs_Shape def) const;
|
||||
Standard_EXPORT GeomAbs_Shape ContinuityVal(const char* const param,
|
||||
const GeomAbs_Shape def) const;
|
||||
|
||||
//! Prints statistics on Shape Processing onto the current Messenger.
|
||||
Standard_EXPORT void PrintStatistics() const;
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
ShapeProcessAPI_ApplySequence::ShapeProcessAPI_ApplySequence(const char* rscName,
|
||||
const char* seqName)
|
||||
ShapeProcessAPI_ApplySequence::ShapeProcessAPI_ApplySequence(const char* const rscName,
|
||||
const char* const seqName)
|
||||
{
|
||||
|
||||
myContext = new ShapeProcess_ShapeContext(rscName);
|
||||
|
||||
@@ -40,7 +40,8 @@ public:
|
||||
|
||||
//! Creates an object and loads resource file and sequence of
|
||||
//! operators given by their names.
|
||||
Standard_EXPORT ShapeProcessAPI_ApplySequence(const char* rscName, const char* seqName = "");
|
||||
Standard_EXPORT ShapeProcessAPI_ApplySequence(const char* const rscName,
|
||||
const char* const seqName = "");
|
||||
|
||||
//! Returns object for managing resource file and sequence of
|
||||
//! operators.
|
||||
|
||||
Reference in New Issue
Block a user