/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #include "DgSheetModelProperties.h" //----------------------------------------------------------------------------------------------------------------------- // property: GeomExtents //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelGeomExtentsProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGeExtents3d extentsValue; if (pObj->getGeomExtents(extentsValue) != eOk) return eInvalidExtents; value = extentsValue; return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: DrawBorderFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelDrawBorderFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getDrawBorderFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelDrawBorderFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setDrawBorderFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: DrawMarginsFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelDrawMarginsFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getDrawMarginsFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelDrawMarginsFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setDrawMarginsFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetNumber //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetNumberProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetNumber(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetNumberProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetNumber(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetWidth //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetWidthProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetWidth(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetWidthProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetWidth(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetHeight //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetHeightProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetHeight(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetHeightProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetHeight(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetOffset //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetOffsetProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetOffset(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetOffsetProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetOffset(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetRotation //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetRotationProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetRotation(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetRotationProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetRotation(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetLeftMargin //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetLeftMarginProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetLeftMargin(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetLeftMarginProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetLeftMargin(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetRightMargin //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetRightMarginProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetRightMargin(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetRightMarginProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetRightMargin(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetTopMargin //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetTopMarginProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetTopMargin(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetTopMarginProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetTopMargin(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetBottomMargin //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetBottomMarginProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetBottomMargin(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetBottomMarginProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetBottomMargin(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetPaperName //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetPaperNameProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetPaperName(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetPaperNameProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetPaperName(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetUnits //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetUnitsProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getSheetUnits(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetUnitsProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setSheetUnits(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: SheetExtents //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgSheetModelSheetExtentsProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgSheetModelPtr pObj = OdDgSheetModel::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGeExtents3d extentsValue; if (pObj->getSheetExtents(extentsValue) != eOk) return eInvalidExtents; value = extentsValue; return eOk; } //-----------------------------------------------------------------------------------------------------------------------