///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
#if !defined(ODA_ODMVDXMLIDENTITY_H_INCLUDED_)
#define ODA_ODMVDXMLIDENTITY_H_INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MvdXmlDefinition.h"
#include "StringArray.h"
/** \details
Contains declarations related to Model View Definition (MVD) functionality.
*/
namespace OdMvdXml
{
SMARTPTR(OdMvdXmlIdentity);
/** \details
The class implements storing and operating data about an MVDXML element with identity.
An element with identity has a set of attributes that allows to distinguish it from other elements of the same type or class.
Identity information is not used for data manipulation, but for element management.
*/
class MVDXML_EXPORT OdMvdXmlIdentity : public OdMvdXmlElement
{
ODRX_DECLARE_MEMBERS(OdMvdXmlIdentity);
public:
/** \details
Creates a new MVDXML element with identity.
*/
OdMvdXmlIdentity();
/** \details
Reads data from a specified XML element.
\param pParent [out] A raw pointer to an XML element object that contains data to read.
\returns eOk if the data was successfully read; otherwise, the method returns an appropriate error code.
*/
virtual OdResult inFields(TiXmlElement* pParent) override;
/** \details
Retrieves the list of authors of the XML element.
\returns An array of strings that contains the list of authors.
*/
OdStringArray& getAutors();
/** \details
Retrieves the XML element code.
The code is a human-readable reference value to get identify the element of the MVD definition.
\returns A string that contains the element code.
*/
OdString& getCode();
/** \details
Sets the new code of the XML element.
The code is a human-readable reference value to get identify the element of the MVD definition.
\param value [in] A string that contains the new element code.
*/
void setCode(const OdString& value);
/** \details
Retrieves the copyright for the XML element.
\returns A string that contains the copyright text.
*/
OdString& getCopyright();
/** \details
Sets the copyright text for the XML element.
\param value [in] A string that contains the copyright text.
*/
void setCopyright(const OdString& value);
/** \details
Retrieves the human-readable name of the XML element.
\returns A string that contains the name.
\remarks
The name acts as a header of the section and as an entry in the table of contents of the generated documentation.
The validation check also reports the name as an identifier when any of the concept-related checks is not met.
This is used as the header of the section and entry within the table of contents when generating documentation.
The name is also reported for a validation against this MVD, if assigned to concepts checked against the MVD.
*/
OdString& getName();
/** \details
Sets the human-readable name of the XML element.
\param value [in] A string that contains the new name.
\remarks
The name acts as a header of the section and as an entry in the table of contents of the generated documentation.
The validation check also reports the name as an identifier when any of the concept-related checks is not met.
This is used as the header of the section and entry within the table of contents when generating documentation.
The name is also reported for a validation against this MVD, if assigned to concepts checked against the MVD.
*/
void setName(const OdString& value);
/** \details
Retrieves the legal owner name of the XML element.
\returns A string that contains the legal owner name.
\remarks
Official Model View Definitions by buildingSMART International shall have the ownership assigned
to buildingSMART or another accepted standardization organization.
*/
OdString& getOwner();
/** \details
Sets the legal owner name of the XML element.
\param value [in] A string that contains the new owner name.
\remarks
Official Model View Definitions by buildingSMART International shall have the ownership assigned
to buildingSMART or another accepted standardization organization.
*/
void setOwner(const OdString& value);
/** \details
Retrieves the current OdMvdStatus of the XML element.
\returns An OdMvdStatus enumeration value that contains the current status of the XML element.
*/
OdMvdStatus getStatus();
/** \details
Sets the status of the XML element.
\param value [in] An OdMvdStatus enumeration value that contains the new status of the XML element.
*/
void setStatus(const OdMvdStatus value);
/** \details
Retrieves the universal unique identifier (UUID) of the XML element.
\returns An OdGUID object that contains the UUID value.
\remarks
UUID acts as a persistent identifier, that never changes its value.
It has the string data type with a fixed length (36 characters) that follows a specific pattern.
*/
const OdGUID& getUuid() const;
/** \details
Sets the universal unique identifier (UUID) of the XML element.
\param value [in] An OdGUID object that contains the UUID value.
\remarks
UUID acts as a persistent identifier, that never changes its value.
It has the string data type with a fixed length (36 characters) that follows a specific pattern.
*/
void setUuid(const OdGUID& value);
/** \details
Retrieves the XML element version.
\returns A string that contains the version number.
*/
OdString& getVersion();
/** \details
Sets the version of the XML element.
\param value [in] A string that contains the version number.
*/
void setVersion(const OdString& value);
protected:
/** \details
Copy data from the other element.
\param other [in] Object to copy from.
*/
void assign(const OdMvdXmlIdentity* other);
/** \details
Reads attributes from a xml element.
\param pItem [in] Pointer to a xml element containing attributes.
\returns eOk if the data was successfully read; otherwise, the method returns an appropriate error code.
*/
virtual OdResult inAttributes(TiXmlElement* pParent) override;
/** \details
Writing attributes to the xml element.
\param pItem [in] Pointer to the xml element to which you want to add attributes.
\returns eOk if the data was written successfully; otherwise, the method returns an appropriate error code.
*/
virtual OdResult outAttributes(TiXmlElement* pItem) override;
/** \details
Universally unique identifier. This is used as a persistent identifier, and must
never change.It is string type with a fixed length of 36 characters, which should
follow a specific pattern.
*/
OdGUID m_uuid;
/** \details
Human readable name.This is used as the header of the section and entry
within table of contents when generating documentation.The name is also
reported for a validation against this MVD, if assigned to concepts checked
against the MVD.
*/
OdString m_name;
/** \details
Human readable reference value of this element of the MVD definition.
*/
OdString m_code;
/** \details
Sequential version number of this element of the MVD definition.
*/
OdString m_version;
/** \details
The status information of this element of the MVD definition.
It has the following enumerators :
- Sample
- Proposal
- Draft
- Candidate
- Final
- Deprecated
*/
OdMvdStatus m_status;
/** \details
The author(s) of his element of the MVD definition.
Authors are separated by semicolon.
*/
OdStringArray m_autors;
/** \details
The legal owner of this element of the MVD definition
NOTE Official Model View Definitions by buildingSMART International shall
have ownership assigned to buildingSMART or another accepted
standardization organization.
*/
OdString m_owner;
/** \details
The copyright under which the work is published.
*/
OdString m_copyright;
/** \details
The attribute name is optional.
*/
bool m_name_opt;
};
/** \details
A service class that stores and operates definitions of MVD XML elements with identities.
*/
class MVDXML_EXPORT OdMvdXmlIdentityDefinitions : public OdMvdXmlIdentity, OdMvdXmlDefinitionsBase
{
ODRX_DECLARE_MEMBERS(OdMvdXmlIdentityDefinitions);
protected:
/** \details
Copy data from the other element.
\param other [in] Object to copy from.
*/
void assign(const OdMvdXmlIdentityDefinitions* other);
/** \details
Reads child element from a xml element.
\param nodeName [in] The node name of the xml element containing the child data.
\param pChild [in] Pointer to a xml element containing child data.
\returns eOk if the data was successfully read; otherwise, the method returns an appropriate error code.
*/
virtual OdResult inChildNode(const char *nodeName, TiXmlElement* pChild) override;
/** \details
Writing child elements to the xml element.
\param pParent [in] Pointer to the xml element to which you want to add children.
\returns eOk if the data was written successfully; otherwise, the method returns an appropriate error code.
*/
virtual OdResult outChildNodes(TiXmlNode* pParent) override;
};
}
#endif // !defined(ODA_ODMVDXMLIDENTITY_H_INCLUDED_)