///////////////////////////////////////////////////////////////////////////////
// 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_ODMVDXMLMODELVIEW_H_INCLUDED_)
#define ODA_ODMVDXMLMODELVIEW_H_INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MvdXmlIdentity.h"
#include "MvdXmlConceptRoot.h"
#include "MvdXmlExchangeRequirement.h"
/** \details
Contains declarations related to Model View Definition (MVD) functionality.
*/
namespace OdMvdXml
{
SMARTPTR(OdMvdXmlModelView);
/** \details
A class that implements a Model View element.
The Model View element defines how the Concept Template is used in a view.
*/
class MVDXML_EXPORT OdMvdXmlModelView : public OdMvdXmlIdentityDefinitions
{
ODRX_DECLARE_MEMBERS(OdMvdXmlModelView);
public:
/** \details
Retrieves the applicable schema for the Model View object.
\returns An ANSI string that contains the schema name (for example, "IFC2X3" or "IFC4").
*/
const OdAnsiString& getApplicableSchema() const { return m_applicableSchema; };
/** \details
Sets the applicable schema for the Model View object.
\param value [in] An ANSI string that contains the schema name (for example, "IFC2X3" or "IFC4").
*/
void setApplicableSchema(const OdAnsiString &value) { m_applicableSchema = value; };
/** \details
Retrieves the base view definition for the Model View object.
The base view is an add-on view that defines restrictions or extensions over another model view definition.
\returns An ANSI string that contains the base view definition.
*/
const OdAnsiString& getBaseView() const { return m_baseView; };
/** \details
Sets the base view definition for the Model View object.
The base view is an add-on view that defines restrictions or extensions over another model view definition.
\param value [in] An ANSI string that contains the base view definition to be set.
*/
void setBaseView(const OdAnsiString &value) { m_baseView = value; };
/** \details
Retrieves the list of Concept Root elements for the Model View object.
The list of Concept Root elements contains the concepts applicable to each entity instance in an IFC data set with template rules.
\returns An array of smart pointers to OdMvdXmlConceptRoot objects.
*/
const OdMvdXmlConceptRootPtrArray& getConceptRoots() const;
protected:
/** \details
Retrieves the name of the element. This name is used to write the element to a file.
\returns The name of the element.
*/
virtual OdAnsiString getElementName();
/** \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
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 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
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;
private:
/** \details
Identifies the default schema for which the template applies, such as
IFC2X_FINAL, IFC2X2_FINAL, IFC2X3, or IFC4.The template may be
used for model views of other schemas, if all enclosed rules resolve to
available attributes and types.
*/
OdAnsiString m_applicableSchema;
/** \details
Reference to a base model view definition(in case that this model view
represents an add - on model view that extents a base view).
*/
OdAnsiString m_baseView;
/** \details
List of exchange requirements defined within this model view.
They should appear in logical order.
*/
OdMvdXmlExchangeRequirementPtrArray m_exchangeRequirements;
/** \details
List of root concepts defined within scope of the model view.
*/
OdMvdXmlConceptRootPtrArray m_roots;
};
}
#endif // !defined(ODA_ODMVDXMLMODELVIEW_H_INCLUDED_)