mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0033230: Data Exchange, DE Wrapper - Update API to find CAD provider
Moved FindProvider method to public section Made FindProvider as virtual to make it possible to overwrite.
This commit is contained in:
parent
62f554bc3f
commit
6cc679d81c
@ -94,7 +94,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
|
|||||||
return Read(thePath, theDocument, theProgress);
|
return Read(thePath, theDocument, theProgress);
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_True, aProvider))
|
if (!FindProvider(thePath, Standard_True, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
|
|||||||
return Write(thePath, theDocument, theProgress);
|
return Write(thePath, theDocument, theProgress);
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_False, aProvider))
|
if (!FindProvider(thePath, Standard_False, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_True, aProvider))
|
if (!FindProvider(thePath, Standard_True, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_False, aProvider))
|
if (!FindProvider(thePath, Standard_False, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
|
|||||||
return Read(thePath, theShape, theProgress);
|
return Read(thePath, theShape, theProgress);
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_True, aProvider))
|
if (!FindProvider(thePath, Standard_True, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
|
|||||||
return Write(thePath, theShape, theProgress);
|
return Write(thePath, theShape, theProgress);
|
||||||
}
|
}
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_False, aProvider))
|
if (!FindProvider(thePath, Standard_False, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
|
|||||||
{
|
{
|
||||||
|
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_True, aProvider))
|
if (!FindProvider(thePath, Standard_True, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
|
|||||||
const Message_ProgressRange& theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Handle(DE_Provider) aProvider;
|
Handle(DE_Provider) aProvider;
|
||||||
if (!findProvider(thePath, Standard_False, aProvider))
|
if (!FindProvider(thePath, Standard_False, aProvider))
|
||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -482,10 +482,10 @@ Handle(DE_Wrapper) DE_Wrapper::Copy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function : findProvider
|
// function : FindProvider
|
||||||
// purpose :
|
// purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean DE_Wrapper::findProvider(const TCollection_AsciiString& thePath,
|
Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath,
|
||||||
const Standard_Boolean theToImport,
|
const Standard_Boolean theToImport,
|
||||||
Handle(DE_Provider)& theProvider) const
|
Handle(DE_Provider)& theProvider) const
|
||||||
{
|
{
|
||||||
|
@ -211,6 +211,16 @@ public:
|
|||||||
Standard_EXPORT void ChangePriority(const TColStd_ListOfAsciiString& theVendorPriority,
|
Standard_EXPORT void ChangePriority(const TColStd_ListOfAsciiString& theVendorPriority,
|
||||||
const Standard_Boolean theToDisable = Standard_False);
|
const Standard_Boolean theToDisable = Standard_False);
|
||||||
|
|
||||||
|
//! Find available provider from the configuration.
|
||||||
|
//! If there are several providers, choose the one with the highest priority.
|
||||||
|
//! @param[in] thePath path to the CAD file
|
||||||
|
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
|
||||||
|
//! @param[out] theProvider created new provider
|
||||||
|
//! @return Standard_True if provider found and created
|
||||||
|
Standard_EXPORT virtual Standard_Boolean FindProvider(const TCollection_AsciiString& thePath,
|
||||||
|
const Standard_Boolean theToImport,
|
||||||
|
Handle(DE_Provider)& theProvider) const;
|
||||||
|
|
||||||
//! Gets format map, contains vendor map with nodes
|
//! Gets format map, contains vendor map with nodes
|
||||||
//! @return internal map of formats
|
//! @return internal map of formats
|
||||||
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
|
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
|
||||||
@ -227,16 +237,6 @@ protected:
|
|||||||
//! @param[in] theResource resource to get priority
|
//! @param[in] theResource resource to get priority
|
||||||
void sort(const Handle(DE_ConfigurationContext)& theResource);
|
void sort(const Handle(DE_ConfigurationContext)& theResource);
|
||||||
|
|
||||||
//! Find available provider from the configuration.
|
|
||||||
//! If there are several providers, choose the one with the highest priority.
|
|
||||||
//! @param[in] thePath path to the CAD file
|
|
||||||
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
|
|
||||||
//! @param[out] theProvider created new provider
|
|
||||||
//! @return Standard_True if provider found and created
|
|
||||||
Standard_Boolean findProvider(const TCollection_AsciiString& thePath,
|
|
||||||
const Standard_Boolean theToImport,
|
|
||||||
Handle(DE_Provider)& theProvider) const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DE_ConfigurationNode::DE_SectionGlobal GlobalParameters; //!< Internal parameters for the all translators
|
DE_ConfigurationNode::DE_SectionGlobal GlobalParameters; //!< Internal parameters for the all translators
|
||||||
|
Loading…
x
Reference in New Issue
Block a user