/////////////////////////////////////////////////////////////////////////////// // 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 "DgRasterAttachmentHeaderProperties.h" //----------------------------------------------------------------------------------------------------------------------- // class: OdDgRasterAttachmentHeader //----------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------- // property: OrientationOrigin //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationOriginProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d originPoint; OdGeVector3d uVector, vVector; pObj->getOrientation(originPoint, uVector, vVector); value = originPoint; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationOriginProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d tmpPoint; OdGeVector3d uVector, vVector; pObj->getOrientation(tmpPoint, uVector, vVector); pObj->setOrientation(*rxvalue_cast(&value), uVector, vVector); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: OrientationUVector //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationUVectorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d originPoint; OdGeVector3d uVector, vVector; pObj->getOrientation(originPoint, uVector, vVector); value = uVector; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationUVectorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d originPoint; OdGeVector3d tmpUVector, vVector; pObj->getOrientation(originPoint, tmpUVector, vVector); pObj->setOrientation(originPoint, *rxvalue_cast(&value), vVector); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: OrientationVVector //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationVVectorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d originPoint; OdGeVector3d uVector, vVector; pObj->getOrientation(originPoint, uVector, vVector); value = vVector; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderOrientationVVectorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdGePoint3d originPoint; OdGeVector3d uVector, tmpVVector; pObj->getOrientation(originPoint, uVector, tmpVVector); pObj->setOrientation(originPoint, uVector, *rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Rotation //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRotationProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getRotation(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRotationProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setRotation(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Affinity //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderAffinityProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getAffinity(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderAffinityProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setAffinity(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Extent //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderExtentProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getExtent(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderExtentProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setExtent(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Resolution //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderResolutionProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getResolution(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderResolutionProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setResolution(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: DisplayGamma //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderDisplayGammaProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getDisplayGamma(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderDisplayGammaProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setDisplayGamma(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: PlotGamma //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderPlotGammaProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getPlotGamma(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderPlotGammaProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setPlotGamma(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: RasterPlane //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRasterPlaneProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getRasterPlane(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRasterPlaneProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setRasterPlane(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: RasterLayer //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRasterLayerProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getRasterLayer(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRasterLayerProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setRasterLayer(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: TransparencyFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getTransparencyFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setTransparencyFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ApplyRotationFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderApplyRotationFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getApplyRotationFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderApplyRotationFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setApplyRotationFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ClippingFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderClippingFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getClippingFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderClippingFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setClippingFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: PlotFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderPlotFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getPlotFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderPlotFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setPlotFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: InvertFlag //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderInvertFlagProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getInvertFlag(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderInvertFlagProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setInvertFlag(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ViewFlags //----------------------------------------------------------------------------------------------------------------------- ODDG_DEFINE_RX_VALUE_ARRAY_ITERATOR(bool); OdRxValueIteratorPtr OdDgRasterAttachmentHeaderViewFlagsProperty::subNewValueIterator(const OdRxObject* pO) const { OdRxValueIteratorPtr res; res = OdRxObjectImpl::createObject(); OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (!pObj.isNull()) { OdArray arrFlags; for (int i = 1; i < 9; i++) arrFlags.push_back(pObj->getViewFlag(i)); ((OdRxboolValueIterator*)res.get())->init(arrFlags, 0); } return res; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderViewFlagsProperty::subTryGetCount(const OdRxObject* pO, int& count) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; count = 8; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderViewFlagsProperty::subGetValue(const OdRxObject* pO, int index, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; index += 1; value = pObj->getViewFlag(index); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderViewFlagsProperty::subSetValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; bool viewFlag = *rxvalue_cast(&value); index += 1; pObj->setViewFlag(index, viewFlag); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderViewFlagsProperty::subInsertValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; return eNotImplementedYet; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderViewFlagsProperty::subRemoveValue(OdRxObject* pO, int index) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; return eNotImplementedYet; } //----------------------------------------------------------------------------------------------------------------------- // property: TintColor //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTintColorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdCmEntityColor cmColor; OdUInt32 uIndex; pObj->getTintColor(uIndex); if (uIndex == OdDg::kColorByLevel) cmColor.setColorMethod(OdCmEntityColor::kByLayer); else if (uIndex == OdDg::kColorByCell) cmColor.setColorMethod(OdCmEntityColor::kByBlock); else if (uIndex < 256) { OdCmEntityColor::setDgnColorIndex(&uIndex, (OdInt16)uIndex); cmColor.setColor(uIndex); } else { ODCOLORREF rgbColor; pObj->getTintColor(rgbColor); cmColor.setColorMethod(OdCmEntityColor::kByColor); cmColor.setRed(ODGETRED(rgbColor)); cmColor.setGreen(ODGETGREEN(rgbColor)); cmColor.setBlue(ODGETBLUE(rgbColor)); } value = cmColor; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTintColorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; const OdCmEntityColor* pColor = rxvalue_cast(&value); switch (pColor->colorMethod()) { case OdCmEntityColor::kByLayer: pObj->setTintColor(OdDg::kColorByLevel); break; case OdCmEntityColor::kByBlock: pObj->setTintColor(OdDg::kColorByCell); break; case OdCmEntityColor::kByACI: pObj->setTintColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByDgnIndex: pObj->setTintColor(pColor->colorIndex()); break; case OdCmEntityColor::kByPen: pObj->setTintColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByColor: { ODCOLORREF curColor = ODRGB(pColor->red(), pColor->green(), pColor->blue()); pObj->setTintColor(curColor); } } return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: HighlightColor //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderHighlightColorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdCmEntityColor cmColor; OdUInt32 uIndex; pObj->getHighlightColor(uIndex); if (uIndex == OdDg::kColorByLevel) cmColor.setColorMethod(OdCmEntityColor::kByLayer); else if (uIndex == OdDg::kColorByCell) cmColor.setColorMethod(OdCmEntityColor::kByBlock); else if (uIndex < 256) { OdCmEntityColor::setDgnColorIndex(&uIndex, (OdInt16)uIndex); cmColor.setColor(uIndex); } else { ODCOLORREF rgbColor; pObj->getHighlightColor(rgbColor); cmColor.setColorMethod(OdCmEntityColor::kByColor); cmColor.setRed(ODGETRED(rgbColor)); cmColor.setGreen(ODGETGREEN(rgbColor)); cmColor.setBlue(ODGETBLUE(rgbColor)); } value = cmColor; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderHighlightColorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; const OdCmEntityColor* pColor = rxvalue_cast(&value); switch (pColor->colorMethod()) { case OdCmEntityColor::kByLayer: pObj->setHighlightColor(OdDg::kColorByLevel); break; case OdCmEntityColor::kByBlock: pObj->setHighlightColor(OdDg::kColorByCell); break; case OdCmEntityColor::kByACI: pObj->setHighlightColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByDgnIndex: pObj->setHighlightColor(pColor->colorIndex()); break; case OdCmEntityColor::kByPen: pObj->setHighlightColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByColor: { ODCOLORREF curColor = ODRGB(pColor->red(), pColor->green(), pColor->blue()); pObj->setHighlightColor(curColor); } } return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Contrast //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderContrastProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getContrast(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderContrastProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setContrast(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Brightness //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBrightnessProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getBrightness(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBrightnessProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setBrightness(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ImageWidth //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderImageWidthProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdUInt32 iWidth = 0, iHeight = 0; pObj->getImageSize(iWidth, iHeight); value = iWidth; return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ImageHeight //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderImageHeightProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdUInt32 iWidth = 0, iHeight = 0; pObj->getImageSize(iWidth, iHeight); value = iHeight; return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ColorMode //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderColorModeProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getColorMode(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: AllColorTransparency //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderAllColorTransparencyProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getAllColorTransparency(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderAllColorTransparencyProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setAllColorTransparency(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: BackgroundTransparency //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBackgroundTransparencyProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getBackgroundTransparency(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBackgroundTransparencyProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setBackgroundTransparency(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ForegroundTransparency //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderForegroundTransparencyProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getForegroundTransparency(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderForegroundTransparencyProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setForegroundTransparency(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Filename //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderFilenameProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getFilename(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderFilenameProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setFilename(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: FilePath //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderFilePathProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getFilePath(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderFilePathProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setFilePath(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: LogicalName //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderLogicalNameProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getLogicalName(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderLogicalNameProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setLogicalName(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: Description //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderDescriptionProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getDescription(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderDescriptionProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->setDescription(*rxvalue_cast(&value)); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: BackgroundColor //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBackgroundColorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdCmEntityColor cmColor; OdUInt32 uIndex = pObj->getBackgroundColor(); if (uIndex == OdDg::kColorByLevel) cmColor.setColorMethod(OdCmEntityColor::kByLayer); else if (uIndex == OdDg::kColorByCell) cmColor.setColorMethod(OdCmEntityColor::kByBlock); else if (uIndex < 256) { OdCmEntityColor::setDgnColorIndex(&uIndex, (OdInt16)uIndex); cmColor.setColor(uIndex); } else { ODCOLORREF rgbColor = pObj->getBackgroundColor(); cmColor.setColorMethod(OdCmEntityColor::kByColor); cmColor.setRed(ODGETRED(rgbColor)); cmColor.setGreen(ODGETGREEN(rgbColor)); cmColor.setBlue(ODGETBLUE(rgbColor)); } value = cmColor; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBackgroundColorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; const OdCmEntityColor* pColor = rxvalue_cast(&value); switch (pColor->colorMethod()) { case OdCmEntityColor::kByLayer: pObj->setBackgroundColor(OdDg::kColorByLevel); break; case OdCmEntityColor::kByBlock: pObj->setBackgroundColor(OdDg::kColorByCell); break; case OdCmEntityColor::kByACI: pObj->setBackgroundColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByDgnIndex: pObj->setBackgroundColor(pColor->colorIndex()); break; case OdCmEntityColor::kByPen: pObj->setBackgroundColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByColor: { ODCOLORREF curColor = ODRGB(pColor->red(), pColor->green(), pColor->blue()); pObj->setBackgroundColor(curColor); } } return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: ForegroundColor //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderForegroundColorProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdCmEntityColor cmColor; OdUInt32 uIndex = pObj->getForegroundColor(); if (uIndex == OdDg::kColorByLevel) cmColor.setColorMethod(OdCmEntityColor::kByLayer); else if (uIndex == OdDg::kColorByCell) cmColor.setColorMethod(OdCmEntityColor::kByBlock); else if (uIndex < 256) { OdCmEntityColor::setDgnColorIndex(&uIndex, (OdInt16)uIndex); cmColor.setColor(uIndex); } else { ODCOLORREF rgbColor = pObj->getForegroundColor(); cmColor.setColorMethod(OdCmEntityColor::kByColor); cmColor.setRed(ODGETRED(rgbColor)); cmColor.setGreen(ODGETGREEN(rgbColor)); cmColor.setBlue(ODGETBLUE(rgbColor)); } value = cmColor; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderForegroundColorProperty::subSetValue(OdRxObject* pO, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; const OdCmEntityColor* pColor = rxvalue_cast(&value); switch (pColor->colorMethod()) { case OdCmEntityColor::kByLayer: pObj->setForegroundColor(OdDg::kColorByLevel); break; case OdCmEntityColor::kByBlock: pObj->setForegroundColor(OdDg::kColorByCell); break; case OdCmEntityColor::kByACI: pObj->setForegroundColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByDgnIndex: pObj->setForegroundColor(pColor->colorIndex()); break; case OdCmEntityColor::kByPen: pObj->setForegroundColor(pColor->colorIndex()); break; //??? case OdCmEntityColor::kByColor: { ODCOLORREF curColor = ODRGB(pColor->red(), pColor->green(), pColor->blue()); pObj->setForegroundColor(curColor); } } return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: RasterFrameId //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderRasterFrameIdProperty::subGetValue(const OdRxObject* pO, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getRasterFrameId(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: MaskClips //----------------------------------------------------------------------------------------------------------------------- ODDG_DEFINE_RX_VALUE_ARRAY_ITERATOR(OdGePoint2d); OdRxValueIteratorPtr OdDgRasterAttachmentHeaderMaskClipsProperty::subNewValueIterator(const OdRxObject* pO) const { OdRxValueIteratorPtr res; res = OdRxObjectImpl::createObject(); OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (!pObj.isNull()) { OdArray arrClips; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); for (OdUInt32 j = 0;j < verticesArr.size(); j++) { arrClips.push_back(verticesArr.getAt(j)); } } ((OdRxOdGePoint2dValueIterator*)res.get())->init(arrClips, 0); } return res; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderMaskClipsProperty::subTryGetCount(const OdRxObject* pO, int& count) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; int tmpCount = 0; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); tmpCount += verticesArr.size(); } count = tmpCount; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderMaskClipsProperty::subGetValue(const OdRxObject* pO, int index, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { value = verticesArr.getAt(index); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderMaskClipsProperty::subSetValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { OdGePoint2d verticePoint = *rxvalue_cast(&value); verticesArr.setAt(index, verticePoint); pObj->setMaskClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderMaskClipsProperty::subInsertValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { OdGePoint2d verticePoint = *rxvalue_cast(&value); verticesArr.insertAt(index, verticePoint); pObj->setMaskClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderMaskClipsProperty::subRemoveValue(OdRxObject* pO, int index) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getMaskClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getMaskClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { verticesArr.removeAt(index); pObj->setMaskClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- // property: BoundaryClips //----------------------------------------------------------------------------------------------------------------------- OdRxValueIteratorPtr OdDgRasterAttachmentHeaderBoundaryClipsProperty::subNewValueIterator(const OdRxObject* pO) const { OdRxValueIteratorPtr res; res = OdRxObjectImpl::createObject(); OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (!pObj.isNull()) { OdArray arrClips; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); for (OdUInt32 j = 0;j < verticesArr.size(); j++) { arrClips.push_back(verticesArr.getAt(j)); } } ((OdRxOdGePoint2dValueIterator*)res.get())->init(arrClips, 0); } return res; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBoundaryClipsProperty::subTryGetCount(const OdRxObject* pO, int& count) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; int tmpCount = 0; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); tmpCount += verticesArr.size(); } count = tmpCount; return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBoundaryClipsProperty::subGetValue(const OdRxObject* pO, int index, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { value = verticesArr.getAt(index); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBoundaryClipsProperty::subSetValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { OdGePoint2d verticePoint = *rxvalue_cast(&value); verticesArr.setAt(index, verticePoint); pObj->setBoundaryClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBoundaryClipsProperty::subInsertValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { OdGePoint2d verticePoint = *rxvalue_cast(&value); verticesArr.insertAt(index, verticePoint); pObj->setBoundaryClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderBoundaryClipsProperty::subRemoveValue(OdRxObject* pO, int index) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; for (OdUInt16 i = 0; i < pObj->getBoundaryClipNumber(); i++) { OdGePoint2dArray verticesArr; pObj->getBoundaryClipVertices(i, verticesArr); if (index < (int)verticesArr.size()) { verticesArr.removeAt(index); pObj->setBoundaryClipVertices(i, verticesArr); return eOk; } index -= verticesArr.size(); } return eInvalidIndex; } //----------------------------------------------------------------------------------------------------------------------- // property: TransparencyIndexEntries //----------------------------------------------------------------------------------------------------------------------- struct OdRxOdDgRasterAttachmentHeaderOdDgIndexTransEntryValueIterator : OdRxValueIterator { OdArray m_arrData; OdUInt32 m_uCurIndex; OdRxOdDgRasterAttachmentHeaderOdDgIndexTransEntryValueIterator() { m_uCurIndex = 0; } virtual void init(const OdArray& arrData, OdUInt32 uStartIndex) { m_arrData = arrData; m_uCurIndex = uStartIndex; } virtual bool done() { if (m_arrData.isEmpty()) return true; return m_uCurIndex == m_arrData.size(); } virtual bool next() { if (m_uCurIndex < m_arrData.size()) m_uCurIndex++; return !done(); } virtual OdRxValue current() const { if (m_uCurIndex >= m_arrData.size()) throw OdError(eInvalidIndex); return m_arrData[m_uCurIndex]; } }; OdRxValueIteratorPtr OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subNewValueIterator(const OdRxObject* pO) const { OdRxValueIteratorPtr res; res = OdRxObjectImpl::createObject(); OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (!pObj.isNull()) { OdArray arrEntries; for (OdUInt32 i = 0; i < pObj->getTransparencyIndexEntryCount(); i++) { arrEntries.push_back(pObj->getTransparencyIndexEntry(i)); } ((OdRxOdDgRasterAttachmentHeaderOdDgIndexTransEntryValueIterator*)res.get())->init(arrEntries, 0); } return res; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subTryGetCount(const OdRxObject* pO, int& count) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; count = pObj->getTransparencyIndexEntryCount(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subGetValue(const OdRxObject* pO, int index, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getTransparencyIndexEntry(index); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subSetValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdDgRasterAttachmentHeader::OdDgIndexTransEntry transEntry = *rxvalue_cast(&value); pObj->setTransparencyIndexEntry(index, transEntry); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subInsertValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdDgRasterAttachmentHeader::OdDgIndexTransEntry transEntry = *rxvalue_cast(&value); pObj->addTransparencyIndexEntry(transEntry); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyIndexEntriesProperty::subRemoveValue(OdRxObject* pO, int index) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->deleteTransparencyIndexEntry(index); return eOk; } //----------------------------------------------------------------------------------------------------------------------- // property: TransparencyRgbEntries //----------------------------------------------------------------------------------------------------------------------- struct OdRxOdDgRasterAttachmentHeaderOdDgRGBTransEntryValueIterator : OdRxValueIterator { OdArray m_arrData; OdUInt32 m_uCurIndex; OdRxOdDgRasterAttachmentHeaderOdDgRGBTransEntryValueIterator() { m_uCurIndex = 0; } virtual void init(const OdArray& arrData, OdUInt32 uStartIndex) { m_arrData = arrData; m_uCurIndex = uStartIndex; } virtual bool done() { if (m_arrData.isEmpty()) return true; return m_uCurIndex == m_arrData.size(); } virtual bool next() { if (m_uCurIndex < m_arrData.size()) m_uCurIndex++; return !done(); } virtual OdRxValue current() const { if (m_uCurIndex >= m_arrData.size()) throw OdError(eInvalidIndex); return m_arrData[m_uCurIndex]; } }; OdRxValueIteratorPtr OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subNewValueIterator(const OdRxObject* pO) const { OdRxValueIteratorPtr res; res = OdRxObjectImpl::createObject(); OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (!pObj.isNull()) { OdArray arrEntries; for (OdUInt32 i = 0; i < pObj->getTransparencyRgbEntryCount(); i++) { arrEntries.push_back(pObj->getTransparencyRgbEntry(i)); } ((OdRxOdDgRasterAttachmentHeaderOdDgRGBTransEntryValueIterator*)res.get())->init(arrEntries, 0); } return res; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subTryGetCount(const OdRxObject* pO, int& count) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; count = pObj->getTransparencyRgbEntryCount(); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subGetValue(const OdRxObject* pO, int index, OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; value = pObj->getTransparencyRgbEntry(index); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subSetValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdDgRasterAttachmentHeader::OdDgRGBTransEntry transEntry = *rxvalue_cast(&value); pObj->setTransparencyRgbEntry(index, transEntry); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subInsertValue(OdRxObject* pO, int index, const OdRxValue& value) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; OdDgRasterAttachmentHeader::OdDgRGBTransEntry transEntry = *rxvalue_cast(&value); pObj->addTransparencyRgbEntry(transEntry); return eOk; } //----------------------------------------------------------------------------------------------------------------------- OdResult OdDgRasterAttachmentHeaderTransparencyRgbEntriesProperty::subRemoveValue(OdRxObject* pO, int index) const { OdDgRasterAttachmentHeaderPtr pObj = OdDgRasterAttachmentHeader::cast(pO); if (pObj.isNull()) return eNotApplicable; pObj->deleteTransparencyRgbEntry(index); return eOk; } //-----------------------------------------------------------------------------------------------------------------------