/////////////////////////////////////////////////////////////////////////////// // THIS FILE IS MACHINE GENERATED!!!! // /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // 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 "OdaCommon.h" #include "RxProperty.h" #include "RxObjectImpl.h" #include "RxAttribute.h" #include "RxCategory.h" #include "RxValueTypeUtil.h" #include "DbLine.h" #include "DbValueTypes.h" /* OdDbLineNormalProperty */ struct OdDbLineNormalProperty : OdRxProperty { static OdRxMemberPtr createObject(const OdRxClass* owner) { OdRxMemberPtr res = OdRxObjectImpl::createObject(); ((OdDbLineNormalProperty*)res.get())->init(__OD_T("Normal"), &OdRxValueType::Desc::value(), owner); return res; } virtual OdResult subChildren(OdArray& children) const { children.append(OdRxSubProperty::createObject(L"X", OdRxValueType::Desc::value(), this)); children.append(OdRxSubProperty::createObject(L"Y", OdRxValueType::Desc::value(), this)); children.append(OdRxSubProperty::createObject(L"Z", OdRxValueType::Desc::value(), this)); return eOk; } virtual OdResult subGetValue(const OdRxObject* pO, OdRxValue& value) const ODRX_OVERRIDE; virtual OdResult subSetValue(OdRxObject* pO, const OdRxValue& value) const ODRX_OVERRIDE; }; OdResult OdDbLineNormalProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; value = static_cast(pObj->normal()); return eOk; } OdResult OdDbLineNormalProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGeVector3d val; if (!(value >> val)) return eInvalidInput; pObj->setNormal(val); return eOk; } /* OdDbLineThicknessProperty */ struct OdDbLineThicknessProperty : OdRxProperty { static OdRxMemberPtr createObject(const OdRxClass* owner) { OdRxMemberPtr res = OdRxObjectImpl::createObject(); ((OdDbLineThicknessProperty*)res.get())->init(__OD_T("Thickness"), &OdRxValueType::Desc::value(), owner); ((OdDbLineThicknessProperty*)res.get())->attributes().add(OdRxUnitTypeAttribute::createObject(static_cast(1))); // TODO: OdRxLocalizedNameAttribute is temporarily down // ((OdDbLineThicknessProperty*)res.get())->attributes().add(OdRxLocalizedNameAttribute::createObject(L"Thickness")); ((OdDbLineThicknessProperty*)res.get())->attributes().add(OdRxDescriptionAttribute::createObject(L"Specifies the thickness of the line")); if (!OdRxCategory::rootCategory()->findDescendant(L"General")) OdRxCategory::createObject(L"General", OdRxCategory::rootCategory()); ((OdDbLineThicknessProperty*)res.get())->attributes().add(OdRxUiPlacementAttribute::createObject(L"General", 9)); return res; } virtual OdResult subGetValue(const OdRxObject* pO, OdRxValue& value) const ODRX_OVERRIDE; virtual OdResult subSetValue(OdRxObject* pO, const OdRxValue& value) const ODRX_OVERRIDE; }; OdResult OdDbLineThicknessProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; value = static_cast(pObj->thickness()); return eOk; } OdResult OdDbLineThicknessProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; double val; if (!(value >> val)) return eInvalidInput; pObj->setThickness(val); return eOk; } /* OdDbLineAngleProperty */ struct OdDbLineAngleProperty : OdRxProperty { static OdRxMemberPtr createObject(const OdRxClass* owner) { OdRxMemberPtr res = OdRxObjectImpl::createObject(); ((OdDbLineAngleProperty*)res.get())->init(__OD_T("Angle"), &OdRxValueType::Desc::value(), owner); ((OdDbLineAngleProperty*)res.get())->attributes().add(OdRxUnitTypeAttribute::createObject(static_cast(2))); // TODO: OdRxLocalizedNameAttribute is temporarily down // ((OdDbLineAngleProperty*)res.get())->attributes().add(OdRxLocalizedNameAttribute::createObject(L"Angle")); ((OdDbLineAngleProperty*)res.get())->attributes().add(OdRxDescriptionAttribute::createObject(L"Specifies the angle of the line")); if (!OdRxCategory::rootCategory()->findDescendant(L"Geometry")) OdRxCategory::createObject(L"Geometry", OdRxCategory::rootCategory()); ((OdDbLineAngleProperty*)res.get())->attributes().add(OdRxUiPlacementAttribute::createObject(L"Geometry", 6)); return res; } virtual OdResult subGetValue(const OdRxObject* pO, OdRxValue& value) const ODRX_OVERRIDE; virtual bool isReadOnly(const OdRxObject*) const ODRX_OVERRIDE { return true; } }; OdResult OdDbLineAngleProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; //>>REPLACE_LINE value = (pObj->endPoint() - pObj->startPoint()).angleTo(pObj->database()->getUCSXDIR()); return eOk; } /* OdDbLineLengthProperty */ struct OdDbLineLengthProperty : OdRxProperty { static OdRxMemberPtr createObject(const OdRxClass* owner) { OdRxMemberPtr res = OdRxObjectImpl::createObject(); ((OdDbLineLengthProperty*)res.get())->init(__OD_T("Length"), &OdRxValueType::Desc::value(), owner); ((OdDbLineLengthProperty*)res.get())->attributes().add(OdRxUnitTypeAttribute::createObject(static_cast(1))); // TODO: OdRxLocalizedNameAttribute is temporarily down // ((OdDbLineLengthProperty*)res.get())->attributes().add(OdRxLocalizedNameAttribute::createObject(L"Length")); ((OdDbLineLengthProperty*)res.get())->attributes().add(OdRxDescriptionAttribute::createObject(L"Specifies the length of the line")); if (!OdRxCategory::rootCategory()->findDescendant(L"Geometry")) OdRxCategory::createObject(L"Geometry", OdRxCategory::rootCategory()); ((OdDbLineLengthProperty*)res.get())->attributes().add(OdRxUiPlacementAttribute::createObject(L"Geometry", 5)); ((OdDbLineLengthProperty*)res.get())->attributes().add(OdRxLMVAttribute::createObject()); return res; } virtual OdResult subGetValue(const OdRxObject* pO, OdRxValue& value) const ODRX_OVERRIDE; virtual bool isReadOnly(const OdRxObject*) const ODRX_OVERRIDE { return true; } }; OdResult OdDbLineLengthProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; //>>REPLACE_LINE value = pObj->startPoint().distanceTo(pObj->endPoint()); return eOk; } /* OdDbLineDeltaProperty */ struct OdDbLineDeltaProperty : OdRxProperty { static OdRxMemberPtr createObject(const OdRxClass* owner) { OdRxMemberPtr res = OdRxObjectImpl::createObject(); ((OdDbLineDeltaProperty*)res.get())->init(__OD_T("Delta"), &OdRxValueType::Desc::value(), owner); // TODO: OdRxLocalizedNameAttribute is temporarily down // ((OdDbLineDeltaProperty*)res.get())->attributes().add(OdRxLocalizedNameAttribute::createObject(L"Delta X;Delta Y;Delta Z")); ((OdDbLineDeltaProperty*)res.get())->attributes().add(OdRxDescriptionAttribute::createObject(L"Specifies the delta of the line")); if (!OdRxCategory::rootCategory()->findDescendant(L"Geometry")) OdRxCategory::createObject(L"Geometry", OdRxCategory::rootCategory()); ((OdDbLineDeltaProperty*)res.get())->attributes().add(OdRxUiPlacementAttribute::createObject(L"Geometry", 4)); return res; } virtual OdResult subChildren(OdArray& children) const { children.append(OdRxSubProperty::createObject(L"X", OdRxValueType::Desc::value(), this)); children.append(OdRxSubProperty::createObject(L"Y", OdRxValueType::Desc::value(), this)); children.append(OdRxSubProperty::createObject(L"Z", OdRxValueType::Desc::value(), this)); return eOk; } virtual OdResult subGetValue(const OdRxObject* pO, OdRxValue& value) const ODRX_OVERRIDE; virtual bool isReadOnly(const OdRxObject*) const ODRX_OVERRIDE { return true; } }; OdResult OdDbLineDeltaProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDbLinePtr pObj = OdDbLine::cast(pO); if (pObj.isNull()) return eNotApplicable; //>>REPLACE_LINE value = pObj->endPoint() - pObj->startPoint(); return eOk; } void createOdDbLineProperties(OdArray& properties, OdRxMemberCollectionBuilder& b, void*) { properties.append(OdDbLineNormalProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDbLineThicknessProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDbLineAngleProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDbLineLengthProperty::createObject(b.owner())); b.add(properties.last()); properties.append(OdDbLineDeltaProperty::createObject(b.owner())); b.add(properties.last()); }